Exercise 10.2 - Simulink to SysML
Objectives
The new learning objective of this exercise is to generate a SysML block structure from a Simulink model.
Preparation
This exercise assumes the student has
Cameo System Modeler 18.0 - 19.0 (or MagicDraw with SysML plug-in) installed correctly on his or her machine with a valid license for use,
Syndeia 3.3 installed as a plugin for Cameo/MagicDraw with a valid license for use,
Syndeia Simulink interface, correctly installed with a valid license for use,
MATLAB/Simulink R2016b or later, installed correctly on his or her machine with a valid license for use.
We will use the Simulink model created in the previous tutorial Exercise 10.1 and create the new SysML model inside MagicDraw project Syndeia Tutorial Testbed.mdzip (get it here - https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330096164).
Exercise
In this exercise, we will use the Simulink model created in the previous tutorial 10.1. If not already open from that exercise, open Syndeia Tutorial Testbed.mdzip (get it here - https://intercax.atlassian.net/wiki/spaces/SYN36/pages/3330096164), and create an empty package named Simulink Tutorial Part 2. Launch the Syndeia dashboard from that package. Select a Syndeia Cloud project, if required.
In the Settings tab, as shown in Figure 1, select the desired options for the Simulink-to-SysML transformation. For example, we chose to create SysML proxy ports from Simulink ports and we want to perform on the transform recursively to deeper and deeper levels of Simulink blocks.
Figure 1 Syndeia Settings tab
Â
In the Connection Manager, load the SysML model on the left, your local file system repository on the right, and select Model Transform in the center. Find and expand the top-level Simulink model file, System.slx, created in the previous exercise. The Simulink model in the file is represented by the icon with a circle, a triangle, and a square (e.g. system in Figure 2 ). Drag and drop that model element to the empty destination package in SysML, as shown in Figure 2.
Figure 2 SysML IBD for the System block
On the pop-up dialog box (Figure 3), select "Generate SysML internal block structure" and click OK.
Figure 3 Drag-n-drop a Simulink model to an empty package to generate a SysML block structure
Â
Once the SysML block model has been generated, go to MagicDraw/Cameo and create a SysML IBD showing the internal structure of the System block. It should appear similar to Figure 4.
Figure 4 System IBD
Once the SysML block model has been generated, go to the Connection Browser tab in the Syndeia dashboard, expand the System block, right-click the connection and select Compare Source & Target. Comparison Result should appear similar to Figure 5.
Figure 5 Comparison Results for SysML-Simulink models
Some versions of MagicDraw/Cameo System Modeler may not initially process the new delegation connectors correctly and generate validation errors. If this occurs, create an IBD for each element, including child elements, that has connectors and MagicDraw should clear the errors.