Search code examples
exportdymola

FMU export from Dymola with exposed inputs


I need to export my Dymola model to Simulink via FMU and I would like to leave some external input signals free to be set directly within Simulink, once the FMU has been imported there.

However, I have seen that my original model in Dymola cannot be translated successfully if I leave any unconnected external input: I get an error because the system is "structurally singular", and the tip that my input signals "should have been connected, and recursive check assumes this".

Since I cannot translate the model, I cannot export it via FMU, unless all input signals are fully specified within Dymola. Is there a workaround for this?


Solution

  • From you description I guess you are not using input connectors, but leave the inputs of instances unconnected.

    Instead of leaving inputs unconnected, you must use input connectors. All top-level inputs and outputs you have in your model will also be inputs and outputs of the FMU. The same is true for parameters. If you want to expose a parameter in the FMU, you have to add a top-level parameter to your Modelica model.

    For example, exporting a simple integrator as FMU like this will not work:

    enter image description here

    By adding inputs and outputs, the model translates and therefore it can also be exported as FMU:

    enter image description here