Versions Compared

Key

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

...

...

...

...

...

...

...

...

...

Image Removed

47 Perimeter Ctr E, Suite 410
Atlanta, GA 303046, USA
Voice: +1-404-592-6897
Web: www.intercax.com
Email: info@intercax.com

...

Objectives

The new learning objectives of this exercise are to generate a more complex state machine structure in a Stateflow from a state machine in a MagicDraw SysML model, including state entry, do and exit behaviors and transition triggers, guards and effects.

...

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, and

  • Syndeia 3.3 installed as a plugin for Cameo/MagicDraw with a valid license for use

  • Syndeia Stateflow interface, correctly installed with a valid license for user.

  • MATLAB/Simulink/Stateflow installed, licensed and available to the user,

  • A local operating system network connection in the Syndeia Repository Manager

The user can use any local operating system network connection they have available. It is generally advisable to carry out these exercises in a non-production repository, a "sandbox", set up for training and practice purposes.

  • An empty destination folder in the local operating system to receive the model.

Example – SysML to Stateflow

...

Image Removed

...

The SysML model shown in Figure 1 will be used in a model transform to Stateflow. In addition to the transform of states and transitions, Syndeia 3.3 also supports transform of state entry, do and exit behaviors and transition triggers, guards, and effects. Only certain SysML-Stateflow mappings are supported:

  • SysML state behaviors and transition effects must be modeled as opaque behaviors.

  • SysML transition triggers must be time events.

  • SysML transition guards are strings.

    Image Added

    Figure 1 SysML Starter Model

The SysML model ThreeStates Plus is found in the Syndeia Tutorial Testbed.mdzip file in the Three State Model with Behaviors package and may be inspected for the exact treatment of these features.

Exercise

  1. If not already open, open the Syndeia Tutorial Testbed.

    mdzip 

    mdzipmodel and launch the Syndeia dashboard from the Three State Model with Behaviors package. Select a Syndeia Cloud project if necessary. Go to the Settings tab. Check the Generate/compare state and transition behaviors and Synchronize state and transition behaviors checkboxes, as shown in Figure 2.

...

Image Removed

...

  1. Image Added

    Figure 2 Syndeia Settings tab

  2. Go to the Connection Manager tab. Expand your SysML model in the left column to show the ThreeStates Plus state machine and your local operating system on the right side to show the empty destination folder (1_Demo_ Stateflow with Behaviors in Figure 3).

...

Image Removed

...

  1. Image Added

    Figure 3  Syndeia Dashboard, Connection Manager tab

  2. Select Model Transform for Connection Type in the central column. Drag and drop the ThreeStates Plus state machine onto the destination folder in the local operating system. Click Yes to confirm. When complete, expand the newly-created Simulink Model to view new Stateflow State Chart and its contents, as shown in Figure 4.

...

Image Removed

  1. Image Added

    Figure

...

  1. Syndeia Dashboard, Connection Manager tab, after generation of state machine structure in the local file system (red highlight shows ThreeStates Plus.slx Simulink model).

  2. In the Connection Manager, right-click the ThreeStates Plus.slx Simulink model (see red highlight in Figure 4) and choose Open. Double-click the state chart symbol to see the states and transitions (Figure 5).

...

Image Removed

...

  1. Image Added

    Figure 5  ThreeStates Plus Statechart

  2. In the Syndeia dashboard Connection Browser tab, expand the SysML model to show the connections for the ThreeStates Plus state machine, as highlighted in Figure 6. Right-click the row and select Compare Source & Target.

...

  1. Image Added

    Figure 6  Syndeia dashboard, Connection Browser tab, new connection between state machines

  2. The Comparison Results are shown in Figure 7.

...

Image Removed

  1. Image Added

    Figure 7 Syndeia Comparison Results after model transform.

  2. Make some changes to the state behaviors or transition characteristics and repeat Compare Source & Target. The differences should appear similar to Figure 8.

...

Image Removed

...

  1. Image Added

    Figure 8  Syndeia Comparison Results after minor changes to Stateflow model