Versions Compared

Key

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

SysML to Stateflow Generation

SysML State Machine -> Stateflow State Chart

  1. Open Syndeia Stateflow Examples model. We will demonstrate the Syndeia Stateflow interface using the ThreeStates State Machine in the Three State Model package shown below.



  2. Launch Syndeia Dashboard and expand to view the contents of the ThreeStates state machine in package Three State Model.



  3. Drag State Machine from SysML to an empty folder in a Local File System repository (add one in the Repository Manager tab and select on RHS of Connection Manager tab if you have not yet done so) then select ‘Yes’ to generate a Simulink model containing a Stateflow State Chart.



  4. Expand newly-created Simulink Model to view new Stateflow State Chart and its contents.



  5. Right-Click > Open to view the Simulink Model



  6. Double-click the state chart in the model after it opens to view states and transitions



  7. Arrange the states and transitions and add any state or transition actions from here. Later versions of Syndeia will begin to automate transfer of this additional information. 

SysML-Stateflow Compare

SysML State Machine - Stateflow State Chart

  1. Start with connected ThreeStates SysML & Stateflow models from previous tutorial



  2. View the connection in the Connection Browser (right-click > Refresh, Expand)



  3. Right-click > Compare SysML & Target and click ‘Yes’ to compare

SysML to Stateflow Change, Compare, and Sync

SysML State Machine -> Stateflow State Chart

  1. Begin with connected/in sync models (from previous tutorials) & modify SysML State Machine as shown below*



  2. Compare SysML & Target again, then sync SysML -> Target



  3. Reopen Simulink/Stateflow model, note the changes that were made, & rearrange if desired



  4. Compare to see models back in sync

Stateflow To SysML Generation

Stateflow State Chart -> SysML State Machine

  1. Unzip Example Stateflow Models.zip to the folder you have connected as a Local File System Repository



  2. Open the Statechart_Test_2 model and view the Feeder state chart it contains



  3. Expand the same Simulink model in Syndeia Dashboard to view the State Chart contents



  4. Drag State Chart from Simulink model to package in SysML and expand to view



  5. Create a SysML State Machine Diagram by right-clicking the Feeder State Machine, selecting Create Diagram, and then SysML State Machine Diagram as shown below



  6. This should automatically display a view of the State Machine in SysML