Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Simulink co-simulation

Cameo Simulation Toolkit supports Simulink (MATLAB) co-simulation. Simulation executes the entire Simulink model (*.slx) on all steps, if there are any value changes in the input, which is similar to FMI. Simulation works with Simulink models as attached files and Simulink models located in the same directory of the project.

Warning
titleWarning
  • You must successfully integrate MATLAB Version 2016b or later before using Simulink co-simulation. See Integration with MATLAB.
  • Any duplicated Simulink model is not allowed in the project.

...

  1. Drag a Simulink model into the Block Definition diagram or Internal Block diagram of the project. The Simulink Import Options dialog will be shown as in the figure below. All input/output Ports are selected by default.

    The Simulink Import Options dialog is shown after dragging a Simulink model into the Block Definition diagram or Internal Block diagram of the project.
    Note
    titleNote
    • You can select the Attach file to the project option to attach the model to be displayed in the Containment tree.
    • The model will be shown as «SimulinkBlock» «Block».
    • The Block name will be used as the model name.
    • Input and output Ports of the Block will be exposed as Flow Ports with directions.


  2. Connect those Flow ports through binding Connectors  in the Internal Block diagram.
  3. Run the simulation. When inputs are available for initialization (e.g., passed via binding), «SimulinkBlock» will be run at the first time and on every input change. You can also see animation of Flow Ports and set breakpoints for debugging.

...

The Simulink co-simulation result from the system which has two Simulink models (GainAdd.slx and Gain5.slx) connected via Flow Ports.

A Simulink model can be used in the Activity diagram through drag-and-drop operation. The dropped Simulink file is presented as an Activity in the Containment tree with the same name as the Simulink model name, and «SimulinkBlock» is automatically applied. Parameters and directions are the same as the Simulink In/Out ports and can be used as a CallBehaviorAction on demand as shown in the figure below.

Image Removed

...

.