Setting up the State Id data type

The State Id data type produces a unique numeric identifier of the currently active state. It can be plotted during the course of a simulation to trace system behavior.

Composite states and submachine states introduce nested regions in the state chart. If there are nested regions in the state chart, it can have multiple active states: one in each active region.

Knowing the active states is particularly important during the debugging process. In order to determine the active substate for a nested region, you need to add another State Id output variable in the Data Browser and set the Default Value to the desired region or submachine name, as shown below:

A screenshot of a computer

Description automatically generated

To configure a State Id data type in multiple active regions

1.    In the State Chart > Data Browser dialog, select the State Id variable and click stateIDconfigbutton.

2.    Select State or Region appears.

3.    Click + to expand the state chart tree.

4.    Select a state or region.

5.    Click OK.

The selected state or region is displayed under Default Value in the Data Browser.