Using Simulink library blocks to generate ready-to-execute Simulink models
Syndeia 3.2 enables users to use any Simulink library block in SysML block structure or SysML activity structure when generating Simulink models. This results in ready-to-execute Simulink models. The package Model Generation::LibBlock Models in the Syndeia Simulink Examples SysML model has example block and activity models that use library blocks. The figure illustrates an example SysML internal block structure that uses 4 Simulink library blocks—Bus Selector, Gain, Not, and Bus Creator.
The package Model Generation::LibBlock Models::Blocks::Simulink LibBlocks in the Syndeia Simulink Examples model includes several blocks defined for representing Simulink library blocks.
Follow the general rules below to define a Simulink library block in SysML.
- Create a SysML block or activity, and assign it the Simulink_Library_Block stereotype available in the Syndeia profile
- Add a value property (for SysML blocks) or property (for SysML activities in MagicDraw) called name and typed by the String value type. The default value of this property must be the exact name of the Simulink library block in the Simulink library.
- Similarly, you may add other properties as required when using the Simulink library blocks, e.g. Add block uses a property Input with value ++ to indicate addition of two input arguments.
- Define flow with primitive value types (Real, Integer, Boolean) to represent the inputs and output of a Simulink library block.
- The input and output ports must be numbered in ascending alphanumeric manner, ending with numbers 1, 2, 3, and so on. For example, input ports on a Simulink library block must be named in1, in2, in3, etc. and output ports on a Simulink library block must be named out1, out2, out3, etc.