Prev Next

Viewing the Generated Model

Once a model has been generated out to either Modelica or Simulink there can be cases where you want to directly work with that model in the external application. This includes any cases where the model is not generated correctly and you need to find the issue in the external application.

Run a model generation using the Start test. or Solve button and then view the generated code.

Viewing the Generated Code

To view the generated Modelica or Simulink code in the Enterprise Architect code editor:

  • Click on the icon in the Toolbar
  • Select the 'Open Simulation Directory' option
    This opens the directory into which the OpenModelica or Simulink code was generated
  • Click on the file to view the script

Accessing the Generated Model

To access the Modelica or Simulink model using the generated code:

  • Click on the icon in the Toolbar
  • Select the 'Open Simulation Directory' option
    This opens the directory into which the OpenModelica or Simulink code was generated
  • Right-click on the file
  • Select from the context menu the 'Edit with <external tool>' option:

In this case a Modelica .mo file is shown. For a Simulink-generated file the filename is Solve.m.

Double-click on the file to open the external application:

  • For Simulink, to view the generated model, you must open the .slx file named after the Block set to SysMLSimModel; here is a view of the Flip-flop example, generated and opened in Simulink:
  • For Modelica, in the Libraries browser, the diagram is named as per the SysMLSimModel Block - double-click on it to open it; here is a view of the OpAmp example, generated and opened in Modelica:

See the Configure SysML Simulation Help topic for more details.

Learn More