Versions Compared

Key

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

...

The features presented in this section require the Simulink license feature for Syndeia.

Generating Simulink model from SysML block

Follow the instructions below to generate Simulink model structure from a SysML block structure.

...

Launch the Syndeia Dashboard for the Blocks package. Select a Local File System Repository on the RHS, as shown in Figure 138 below.

...

  • SysML block -> Simulink model
  • SysML block part properties -> Simulink model references
  • SysML block ports (full, proxy, flow) -> Simulink ports
  • SysML block connectors between ports -> Simulink lines with signal/bus flows

As see in Figure 142 above, a Simulink model were generated for each SysML block in the context of the System block structure. Part properties pA, pB, and pC of the System block were generated as model references with the same name in the Simulink model. Full, proxy, and flow ports of the System block were generated as Simulink ports, and connectors were generated as lines with signal flows. 

...

Generating Simulink model from SysML activity

Follow the instructions below to generate Simulink model structure from a SysML activity structure.

...

  • SysML activity -> Simulink model
  • SysML activity call behavior actions -> Simulink model references
  • SysML activity parameter nodes -> Simulink ports
  • SysML activity object flows -> Simulink lines with signal/bus flows

As see in Figure 150 above, Simulink models were generated for each SysML activities in the context of the Overall Mission activity. Call behavior actions ma, mb, and mc of the Overall Mission activity were generated as model references with the same name in the Simulink model. Activity parameter nodes were generated as Simulink ports, and object flows were generated as lines with signal flows.
 

...

Compare SysML block/activity connection with Simulink model

...

  1. Addition/removal of part properties in a block and call behavior actions in an activity
  2. Addition/removal of connectors in a block and object flows in an activity
  3. Addition/removal of full/proxy/flow ports in a block and activity parameter nodes in an activity
  4. Rewiring of connectors in a block and object flows in an activity, e.g. changing the source and/or target ends.
  5. Changing names and type of part properties in a block and call behavior actions in an activity
  6. Changing names and types of flow ports in a block and activity parameter nodes in an activity

Compare operation when Simulink model is changed
 

...

  1. two inports with names and types as in1: double and in2: int32
  2. two outports with names and types as out1: double and out2: boolean
     

...

Image Removed

Figure 160: Run compare on the connection between PartC1 and corresponding Simulink model
 

...

Image Removed

Figure 161: Comparison results
 

...

In general, Syndeia can detect the following types of changes in the Simulink model when comparing with a connected SysML model.

    1. Addition/removal of model reference blocks or library blocks
    2. Addition/removal of lines (block connections)
    3. Addition/removal of inports and outports
    4. Rewiring of lines in a Simulink model
    5. Changing names and type of model reference blocks
    6. Changing names and types of inports and outports

Using Simulink library blocks to generate ready-to-execute Simulink models

Syndeia 3.0 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. Figure 162 illustrates an example SysML internal block structure that uses 4 Simulink library blocks—Bus Selector, Gain, Not, and Bus Creator.

Image Removed

Figure 162: SysML internal block structure using Simulink library blocks

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.

  1. Create a SysML block or activity, and assign it the Simulink_Library_Block stereotype available in the Syndeia profile
  2. Add a value property (for SysML blocks) or property (for SysML activities) 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. Activity models in Rhapsody are not allowed to have properties. Use local tags instead.
  3. 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.
  4. Define flow with primitive value types (Real, Integer, Boolean) to represent the inputs and output of a Simulink library block.
  5. 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.