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

Using OME compiled C code as input of other model

Using OME compiled C code as input of other model

Hi All,

I am new to OpenModelica and want to ask some details about compiled c code. I understand that if we build our custom model, then we can use the model within other models as a subsystem.

I was wondering if we could do the same for the compiled c code, like if we can compile the the model into c, and expose the essential parameters or input outputs as function parameters ( eg: void myModel(type_a port_a, type_b out...) {} ), and integrate it with embedded systems. Currently if I dive into the compiled c code, it seems that all signals are defined by equations, and there is no simple way to call/use the compile c model in other platform..

Any related example would be very helpful as well!

Thanks,

Re: Using OME compiled C code as input of other model

You are probably interested in the FMI export from OMEdit. See also: fmi-standard.org

Re: Using OME compiled C code as input of other model

Thanks for the suggestion!

Following up on that, I think after being able to generate the model into FMU, I would also want to connect the signals to/from the embedded systems. However, it seems that code generation from FMU will contain all data in a big struct in "simulation_data.h". I was wondering if it is possible to separate the each subsystem into each data struct?

Thanks.

There are 0 guests and 0 other users also viewing this topic
You are here: