Versions Compared

Key

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

Syndeia 3.3 (Plugin for Rhapsody)
Tutorial Exercise 12.2
Comparing and Syncing SysML and Stateflow State Machines

Image Added

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


Revision Date: July 15, 2020

Objectives

The new learning objectives of this exercise are to compare and update state machine structures in SysML and Stateflow.

Preparation

This exercise assumes the student has

  • Anchor
    _Hlk44840893
    _Hlk44840893
    IBM Rational Rhapsody 8.2 installed correctly on his or her machine with a valid license for use, and
  • Syndeia 3.3 installed as a plugin for Rhapsody 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.

  • Completed Exercise 12.1 and either still has the SysML model open or has saved and reopened it.

Exercise

  1. Anchor
    _Hlk42769490
    _Hlk42769490
    We start from the Syndeia Tutorial Testbed.rpy model at the end of Exercise 12.1. If you have not saved the connections created in this exercise, repeat the exercise. Save and close the Simulink model.


  1. Modify the SysML state machine by adding a new state and two transitions, as shown in Figure 1.


Image Added

Anchor
_Ref377032889
_Ref377032889
Figure 1 Rhapsody showing Statechart state machine diagram after modification


  1. From the Syndeia Connection Browser (Figure 2), find the ThreeStates connection, right-click and select Compare Source & Target.


Image Added

Anchor
_Ref377033033
_Ref377033033
Figure 2 Syndeia Dashboard, Connection Browser tab

  1. The Comparison Result tab should appear as shown in Figure 3.


Image Added

Anchor
_Ref377033109
_Ref377033109
Figure 3 Syndeia Dashboard, Comparison Results tab,


  1. Back in the Syndeia Connection Browser (Figure 2), find the statechart_0 connection, right-click and select Sync Source -> Target (make sure Simulink model is saved and closed before updating). Re-open the Simulink statechart_0.slx model and double-click the state chart symbol to see the updated states and transitions (Figure 4).


Image Added

Image Added

Anchor
_Ref377033306
_Ref377033306
Figure 4 statechart_0 state machine after
first update.

Anchor
_Ref42760925
_Ref42760925
Figure 5 statechart_0 state machine after second update.

  1. Modify the ThreeStates model in StateFlow as shown in Figure 5 by moving the outgoing transition of the Standby state from the On state to the FailState state. Save the StateFlow model.


  1. In the Connection Browser, find the statechart_0 connection, right-click and select Compare Source & Target. The result should be similar to Figure 6. Note the difference in the Standby outgoing transition. Syndeia 3.3 cannot update Rhapsody state machines from Stateflow.


Image Added

Anchor
_Ref42761691
_Ref42761691
Figure 6 Comparison Result after modifying Stateflow statechart_0 state machine diagram