- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » External Control of a simulation
External Control of a simulation
External Control of a simulation
Hello,
Do you know how to control a simulation from a C++ application ?
I explain my need :
I need to control from a custom C++ HMI a simulation step by step and for each calculation step :
- Before the calculation step, I need to modify some parameters of the model
- After the calculation step, I need to retrieve some variables of the model.
Thank you for your help.
Re: External Control of a simulation
Hello pco38
You can do it using sockets. There is a sample here (http://www.modelica-forum.com/forums/lo … p/t17.html) that is also referenced here (http://kempproject.blogspot.com.es/2013 … art-1.html).
This sample shows communication between an OpenModelica simulation and other programs for co-simulation.
It is very simple. If you find any problem please post it.
Now OpenModelica supports CORBA for communication with simulations. However most of times OpenModelica users do not need the sophisticated CORBA interface. A very simple message exchange library as the one shown in example is just enough. It would be great if OpenModelica project would include something similar.
Best regards
Koldo
Re: External Control of a simulation
You're welcome
Anyway a question still unsolved for the Modelica model is to know exactly the simulation steps.
Now the model do not know when a step has finished. That is a matter of the solver and remains hidden for the model. This makes more difficult to couple simulations.
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » External Control of a simulation