Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » Mary_90
  • » Profile

Posts

Posts

Dear Sjoelund.se:

My concern now is about the variables that are received in my UA Expert:

https://openmodelica.org/images/agorapro/attachments/5020/mini_ScreenShot525.jpg

As you can see in the image attached (From the modelica.fluids.examples.tanks.emptytanks), there exist variables that are not shown in the UA expert meanwhile the OMEdit it does. For example, the variable pipe.port_a.m_flow is not shown in the UAExpert. Am I missing something when I create the .exe or running the program?

this is the code that I use to compile the program:

Code:

loadModel(Modelica); 

loadFile("C:/Users/sldmca/Documents/Dymola/emptytanks.mo");
simulate(emptytanks,startTime=0.0, stopTime=100.0);

And this to run the program with the UA server:

Code:

 emptytanks.exe -embeddedServer=opc-ua -rt=1

Thanks a lot for your help, with your tips I am getting further that I expected! I am sure that at the end I will manage to futfill my task!

Kind regards

Dear sjoelund.se ,

It worked out, you're amazing!
Thank you for your kindness and your fast reply, I really appreciate it.

When receiving in the UA Client the variables once the .exe runs at real time, I cannot see all the model variables (those which I would see after having run normally the model in OM in the 'Plot' tab). With which criteria does OpenModelica sets the variables which will be sent to the client? Can they be modified so as to include those that are left?

Best regards,
Mary.

Dear sjoelund.se,

I am trying the UA Interface as you suggested for the interactive simulation. I have been testing the UA Server and UA Client for using some demo variables from the software.

The one thing I need is to link the server to the OpenModelica, so as the client can ask for some variables during the simulation.

How can I do this link? How can I link the compiled .exe from OpenModelica to the UAServer?

I have not found anything at all about the procedure for doing so.

Thank you very much in advance,

Best regards,
Mary

There is one issue that I don´t understand completely.
in OM versión 1.8.1 I am able to perform interactive simulations with inputs and responses from the program. Unfortunately, this function seems that have been deactivated for the following OM versions.

Hi,

There are several ways of dealing with this:
1. use OpenModelica 1.8.1 which still has the interactive stuff
2. use external functions in when equations to set the values of the variables you're interested in
3. use FMI, export your model in an FMU and load it and then you can change the values of variables.

For 3 you will need an FMI library to load the fmu in your process.

However, Real Time simulation is only available after up to date 1.10.1 , as it is explained in the link that you provided last friday https://openmodelica.org/doc/OpenModeli … mpiler-omc

I am not sure if I if I will run an interactive simulation in 1.8.1 the time step is synchronised with the real time. I suppose that no. In point 2, using external functions, does there exist any documentation about how to perform this task? Is this perform made with the OPC UA tool?

Again, that a lot for your quick responses, are being very very useful!
Regards



There is one issue that I don´t understand completely.
in OM versión 1.8.1 I am able to perform interactive simulations with inputs and responses from the program. Unfortunately, this function seems that have been deactivated for the following OM versions.

Hi,

There are several ways of dealing with this:
1. use OpenModelica 1.8.1 which still has the interactive stuff
2. use external functions in when equations to set the values of the variables you're interested in
3. use FMI, export your model in an FMU and load it and then you can change the values of variables.

For 3 you will need an FMI library to load the fmu in your process.

However, Real Time simulation is only available after up to date 1.10.1 , as it is explained in the link that you provided last friday https://openmodelica.org/doc/OpenModeli … mpiler-omc

I am not sure if I if I will run an interactive simulation in 1.8.1 the time step is synchronised with the real time. I suppose that no. In point 2, using external functions, does there exist any documentation about how to perform this task? Is this perform made with the OPC UA tool?

Again, that a lot for your quick responses, are being very very useful!
Regards



Ok, I will try with this,

On the other hand, and related to this, I'd have a second question.

Imagine the output I am plotting with your method is a tank level sensor. Suppose the level is achieving the top tank level, and in orther to avoid overflow I need to change a model input via keyboard as can be a valve opening. Would this be posible with OM?

Thank you very much indeed.

Ok, I will try with this,

On the other hand, and related to this, I'd have a second question.

Imagine the output I am plotting with your method is a tank level sensor. Suppose the level is achieving the top tank level, and in orther to avoid overflow I need to change a model input via keyboard as can be a valve opening. Would this be posible with OM?

Thank you very much indeed.

Dear sjoelund.se,

Thank yoy very much for your reply. According to your advice, I downloaded the last nighty build and used the rt simflag.

When executing this:


simulate(dcmotor, startTime=0.0, stopTime=30.0, cflags="-g", measureTime=true, simflags="-rt 0.5");


I see in fact the Time Simulation is fairly 15s. If instead of 0.5 I use -rt 2, the Time Simulation changes to 60s, which is fine.

The problema is that at the end I get the final plot, instead of a real time plotting which is generated as real time passes.

How could I see the outpout plot being generated as real time passes?

Best regards,

P.S.: With Dymola as well as with Wolfram, just by selecting in 'Simulate Options' the option "Real-time synchronization", I achieved my goal of watching the outputs being plotted as the simulation takes places following real time. I would need to perform the same with OM.

Hi all, I am using OpenModelica since some months ago and I have a issue with the real time. After a week researching about how to simulate a model in real time, I found out your example with several tanks and with the implementation DACSRealTimeSynchronization. It looked as a promising up to date to solve my issue.  I added de .h and .c files to my folder. I have check the model and everyting was fine. But when OM is compiling the program, the following problem arose:

"
[DACSRealTimeSynchronization: 14:3-19:19]: Could not find library libTimerFunction.o in either of:
  C:/OpenModelica//lib//libTimerFunction.o.dll
  C:/OpenModelica//lib//liblibTimerFunction.o.a
  C:/OpenModelica//lib//liblibTimerFunction.o.lib
  C:/OpenModelica//lib//omc/libTimerFunction.o.dll
  C:/OpenModelica//lib//omc/liblibTimerFunction.o.a
  C:/OpenModelica//lib//omc/liblibTimerFunction.o.lib
  %APPDATA%/.openmodelica/binaries/Bombeo/libTimerFunction.o.dll
  %APPDATA%/.openmodelica/binaries/Bombeo/liblibTimerFunction.o.a
  %APPDATA%/.openmodelica/binaries/Bombeo/liblibTimerFunction.o.lib
  C:/Users/sldmca/Documents/Dymola/Resources/Library/mingw32/libTimerFunction.o.dll
  C:/Users/sldmca/Documents/Dymola/Resources/Library/mingw32/liblibTimerFunction.o.a
  C:/Users/sldmca/Documents/Dymola/Resources/Library/mingw32/liblibTimerFunction.o.lib
  C:/Users/sldmca/Documents/Dymola/Resources/Library/win32/libTimerFunction.o.dll
  C:/Users/sldmca/Documents/Dymola/Resources/Library/win32/liblibTimerFunction.o.a
  C:/Users/sldmca/Documents/Dymola/Resources/Library/win32/liblibTimerFunction.o.lib
  C:/Users/sldmca/Documents/Dymola/Resources/Library/libTimerFunction.o.dll
  C:/Users/sldmca/Documents/Dymola/Resources/Library/liblibTimerFunction.o.a
  C:/Users/sldmca/Documents/Dymola/Resources/Library/liblibTimerFunction.o.lib"

In addition,  The compiler dialog said:
"
c:/openmodelica/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -llibModelicaRead.o
c:/openmodelica/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -llibTimerFunction.o
c:/openmodelica/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -llibModelicaPrint.o
collect2: ld returned 1 exit status
\MinGW\bin\mingw32-make: *** [omc_main_target] Error 1
Compilation process failed. Exited with code 2."

I am a bit lost. I am not sure how to make OM créate the neccesary .o file or if I am loosing any step.

I would be very pleased if anyone could help.

Kind regards

  • Index
  • » Users
  • » Mary_90
  • » Profile
You are here: