On this page
Basic guidelines
The main (selected root owning Block) is exported into a separate *.slx file with a Block name.
All other used or referenced Blocks are exported as one library *.slx file.
- Blocks which have classifier behavior as statemachine are exported as Stateflow blocks.
- Blocks which behavior is described by Parametric equations are exported as SFunctions or Simscape models
- If blocks have bidirectional (inout) ports, Simscape should be selected as export option, as Simulink only supports unidirectional inports and outports.
- Use ssc_build in Matlab to generate library and blocks from generated Simscape files
- Both flow ports and proxy ports are supported if they represent one primitive flow type (typed by Real, Integer, Boolean, or one of their specializations)
- Connector must link ports, can’t be attached directly to the part
- Ports must be typed
- InstanceSpecifications can be used to define or overwrite initial parameter values
Data types mapping
Currently not supported
- Proxy port/Interface block with more than 1 flow property (composite signals or buses)
- Behaviors defined as Activity diagrams or Interactions (Sequence diagrams)
- Mixing of Parametrics and StateMachine in one Block
- Enumerations
- Multiplicities
More constraints and examples can be found in SysPhS specification document. Click here to access it.
Diagram layout
Shape and path positions in IBD and Statemachine diagrams are exported, however result is not exactly the same sometimes and can be changed or distorted on the Simulink side.
Note that Simulink only allows input ports on the left, outputs on the right, so adjust your SysML IBD diagrams accordingly to get best visual result and avoid automatic ports and connectors replacements.
- First owned IBD is exported as Simulink block diagram in case of multiple owned IBDs in a Block.
- Nested symbols such as nested parts or ports are not supported
- If there is more than one connector going in or out of same port, Simulink will merge them into one and adds the branching point
Invoking export function
To export to the Simulink model
- In the Model Browser, select the Block to export.
- Do one of the following:
- Click File > Export To > Simulink.
- Right-click the selected Block and then click Tools > Export to Simulink.
- Click File > Export To > Simulink.
Export Options
- Format: choose between the legacy textual .mdl or newer compressed XML-based file format
- S-Function or Simscape: select how to export SysML parametrics - as Simscape or S-Function
- Simscape port libraries: whether to create or reuse existing port types
- Output: the output location and the Simulink file name