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

Working with ControlBus

Working with ControlBus

I try to use the ControlBus to connect several Parts with each other throuhgh it, but nothing works.
If I copy the Controlbus to make my own model I dont see the connections on the GUI and I can't drag the lines to make the connection.
Can somebody please helps me how to connect parts to the bus becaus I have't found any documentions about this topic.

Re: Working with ControlBus

Hi,

We do not yet have functionality in OMEdit to connect components to expandable connectors.
The only way right now is to do it manually in the text editor, i.e.
connect(bus.yourVar, realVar);

Cheers,
Adrian Pop/

Re: Working with ControlBus

I'm a new user of the tool
I there a procedure that describe the way to compile the c++ generated code by OMC ?
The header files and the librairies to compile the this code are not available in the setup of OM.

Re: Working with ControlBus

Hi,

Of course they are, otherwise we could not compile the generated C code.
some of the libs/headers are in:
C:\OpenModelica1.X.Y\include\omc and C:\OpenModelica1.X:Y\lib\omc
some others are in:
C:\OpenModelica1.X.Y\MinGW

Have a look in your Windows TemporaryDirectory/OpenModelica/OMEdit/ after you simulate a model,
and you will see Model.exe and Model.makefile in there. Have a look in Model.makefile to see how we compile the Model.exe from code using MinGW gcc.

Cheers,
Adrian Pop/

Re: Working with ControlBus

Hi ,

I saw the generated c-code in the temporary folder of windows and I succeed to compile it using the generated makefile.

But I've tried the same manipulation with the Cpp code (in a command line with simCodeTarget=Cpp) :
omc +s +q +simCodeTarget=Cpp MyLib.mo

If I try to compile :
mingw32-make.exe -f MyLib.makefile

The following errors appears :
MyLib.makefile:2: C:/OpenModelica1.9.0Beta//include/omc/cpp/ModelicaConfic.inc: No such file or directory
mingw32-make.exe: *** No rule to make target `C:/OpenModelica1.9.0Beta//include/omc/cpp/ModelicaConfic.inc'.  Stop.
There is no Cpp Folder in C:/OpenModelica1.9.0Beta//include/omc/

I saw that the generated Cpp code is relatively intendant : the main functionalities as initializing parameters, variables, update equations and compute
events are available to describe the system and plug a solver. Do you think in this case that the dependencies on OM environment may be reduced ?

Cheers,

F. NOEL

Re: Working with ControlBus

Why not use the C-code? It's C++-compatible current/smile If you want to use the C++ codegenerator, you need to compile omc yourself since the C++ code depends on a lot of runtime libraries that we do not want to include with OpenModelica.

Re: Working with ControlBus

Hi,

Oh, you're talking about the C++ back-end. No that's not available in the installation yet.
You need to download OpenModelica:
https://openmodelica.org/svn/OpenModelica/trunk/
user: anonymous
pass: none <--- write none here
and compile the SimulationRuntime/cpp
make -f Makefile.omdev.mingw runtimeCPP runtimeCPPinstall
and you'll get in in the build directory.

You will nee many more things, read README-OMDev-MinGW.txt in the top folder.

I don't really know why we don't ship the CPP runtime, we should do that.

Cheers,
Adrian Pop/

Re: Working with ControlBus

That's easy to answer: it doesn't work well in Linux.

There are 0 guests and 0 other users also viewing this topic