Compare SysML block/activity connection with Simulink model
The model transform connections between SysML block/activity and corresponding Simulink models make it possible to compare the SysML block/activity structure and the Simulink model downstream. In this section, we will first demonstrate the compare operation when SysML block/activity is changed followed by the demonstration of compare operation when Simulink models are changed.
Compare operation when SysML model is changed
- In the Blocks package in Rhapsody, create a new block B11 with an input flow port in1 and output flow port out1, both typed by Integer value type.
- In the Internal Block Diagram for the block PartB1, add a new part property pb11 typed by the new block B11, and create connectors as shown below.
- Click on the Connection Browser tab, select the connection under PartB1, right click and select Compare SysML and Target, as shown below.
- The Comparison Result tab will open and show the comparison table. This may take few seconds as Syndeia launches Simulink and queries the model. Green rows indicate in-sync and red rows indicate out-of-sync elements. The table shows that property pb11 is new in SysML (does not exist in Simulink) and so are the 2 connectors added in the IBD.
- Next, we will make changes to the activity model. In the Activity package in Rhapsody, create a new activity Mission B11 in with one input activity parameter b11In1 and one output activity parameter b11Out1, both typed by Integer.
- In the activity diagram for the existing activity Mission B1, add a call behavior action mb11 typed by the activity Mission B11, and create new object flows as shown below.
Add call behavior action mb11 (of type Mission B11) in Mission B1 activity
- Click on the Connection Browser tab, select the connection under Activity::Mission B1, right click and select Compare SysML and Target, as shown below.
The Comparison Result tab will open and show the comparison table. This may take few seconds as Syndeia launches MATLAB/Simulink and queries the model. Green rows indicate in-sync and red rows indicate out-of-sync elements. The table shows that call behavior action mb11 is new in SysML (does not exist in Simulink) and so are the 2 object flows in Mission B1—added in the activity model.
In general, Syndeia can detect the following types of changes in the SysML model when comparing with a connected Simulink model:- Addition/removal of part properties in a block and call behavior actions in an activity
- Addition/removal of connectors in a block and object flows in an activity
- Addition/removal of full/proxy/flow ports in a block and activity parameter nodes in an activity
- Rewiring of connectors in a block and object flows in an activity, e.g. changing the source and/or target ends.
- Changing names and type of part properties in a block and call behavior actions in an activity
- Changing names and types of flow ports in a block and activity parameter nodes in an activity
Compare operation when Simulink model is changed
- Create a new Simulink model PartC11 with:
- two inports with names and types as in1: double and in2: int32
- two outports with names and types as out1: double and out2: boolean
- In the existing Simulink model PartC1, add a new model reference block pointing to the new model PartC11, and connect lines between ports, as shown below. Save the PartC1 Simulink model.
- In the Syndeia Dashboard, click on the Connection Browser tab, select the connection under Blocks::PartC1 block, right click, and select Compare SysML & Target.
- The Comparison Result tab will open and show the comparison table. This may take few seconds as Syndeia launches MATLAB/Simulink and queries the model. Green rows indicate in-sync and red rows indicate out-of-sync elements. The table shows the new block pc11:PartC11 added to the Simulink model that does not exist in SysML, and the 4 new lines added to PartC1 Simulink model that do not exist in SysML.
- Similarly, you can add repeat the steps 1-4 for a Simulink model connected to a SysML activity.
In general, Syndeia can detect the following types of changes in the Simulink model when comparing with a connected SysML model.
- Addition/removal of model reference blocks or library blocks
- Addition/removal of lines (block connections)
- Addition/removal of inports and outports
- Rewiring of lines in a Simulink model
- Changing names and type of model reference blocks
- Changing names and types of inports and outports