Reference-FMUs
Reference-FMUs copied to clipboard
fmusim: stopTime ignored in versions >v0.0.22
Hi,
In PR https://github.com/modelica/Reference-FMUs/pull/353 fmusim
starts ignoring the stop time defined either in CLI arguments or in the DefaultExperiment
.
Here are some logs with the latest version:
fmi2Instantiate(instanceName="instance1", fmuType=1, fmuGUID="{BD403596-3166-4232-ABC2-132BDF73E644}", fmuResourceLocation="file:///tmp/fmusim.5M09Db/resources/", functions={logger=0x0x557f9677e534, allocateMemory=0x0x7eff94db2530, freeMemory=0x0x7eff94db1c40, stepFinished=0x(nil), componentEnvironment=0x0x557f96d41b90}, visible=0, loggingOn=0) -> OK
fmi2SetupExperiment(toleranceDefined=0, tolerance=0, startTime=0, stopTimeDefined=0, stopTime=0) -> OK
And in v22:
fmi2Instantiate(instanceName="instance1", fmuType=1, fmuGUID="{BD403596-3166-4232-ABC2-132BDF73E644}", fmuResourceLocation="file:///tmp/fmusim.L1j26L/resources/", functions={logger=0x0x555f6acbe42a, allocateMemory=0x0x7fbe2388c530, freeMemory=0x0x555f6acba730, stepFinished=0x(nil), componentEnvironment=0x0x555f6c1b8370}, visible=0, loggingOn=0) -> OK
fmi2SetupExperiment(toleranceDefined=0, tolerance=0, startTime=0, stopTimeDefined=1, stopTime=10) -> OK
This was extracted by running the Stairs FMU.
What is the rationale for ignoring the defined stop time? Is this is a bug in fmusim? Should all FMUs work the same without prior knowledge of the stop time? (this would indicate a potential bug on our end)
Not passing the stop time to the FMU allows the importer to continue a simulation using a recorded FMU state. The stop time will still be used to end the simulation loop. Does your FMU need to know the stop time in advance?