I am trying to set the value of a parameter in JModelica using the approach given in section 4.4.1 of the user manual; however when I load an fmu and try to change the value I get the message:
File "src\pyfmi\fmi.pyx", line 209, in pyfmi.fmi.ModelBase.set
(src\pyfmi\fmi.c:4707)
File "src\pyfmi\fmi.pyx", line 1397, in pyfmi.fmi.FMUModelBase._set
(src\pyfmi\fmi.c:17750)
File "src\pyfmi\fmi.pyx", line 1099, in pyfmi.fmi.FMUModelBase.set_real
(src\pyfmi\fmi.c:14891)
FMUException: Failed to set the Real values.
I am able to set some parameters of the fmu using this approach, but this one just doesn't want to work. I have also tried to set the parameter with the same variable directly read from the fmu using .get() and the error still occurs.
Does anyone know what is causing this error and how it can be resolved?
Edit: I tried with a few other parameters and it seems that the error only occurs with parameters with units assigned to them i.e. parameters of Power and Mass [W] Flow [kg/s] units. Does this mean that it is only possible to change parameters in the FMU that are Real and that do not have units using this approach??