-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run-single initializes FMU before setting initial values #110
Comments
It is easy enough to just move the First, note that the Here is how the initialisation functions map to FMI functions for the two versions. For FMI 1,
In other words, it doesn't really matter when For FMI 2,
Here, there could in principle be an issue, because certain types of variables cannot be set after |
Well, this is embarrassing. My FMUs are using FMI version 1, and after reading your comments and taking a nice little dive into the code I've come to the same conclusion as you:
I'm also not able to reproduce the behavior I originally described, so this must be down to a good old user error. Apologies! |
cosim run OspSystemStructure.xml
will set user defined initial values beforecosim::simulator::setup()
is called.cosim run-single MyFmu.fmu foo=bar
will set user defined initial values aftercosim::simulator::setup()
is called, see run_single.cpp:275.cosim::simulator::setup()
eventually calls the FMIinitialize()
method which means, in the latter case, that the FMU will be initialized before the desired initial values have been set.I have a number of FMUs which are vitally dependent on a variable having a certain value before
fmi::initialize()
is called, the prime example being the path of a resource file not known at FMU generation time. Being able to usecosim run-single
for debugging would be great. Until now I've had to create a simple OspSystemStructure.xml and usecosim run
for this purpose.The text was updated successfully, but these errors were encountered: