Using triggers to control a state chart from the block diagram

If you want to control your state chart from the block diagram, use the trigger block in the continuous space and connect it to a Boolean expression. When input to the trigger block is 1, the trigger activates; when input is 0, it de-activates.

In the diagram below, a pulseTrain block is used to control the trigger. When the simulation starts, the initial state transitions to State1, and the variable a = 2. When the trigger goes high, State1 transitions to the final state. On State1 exit, a = 3. The variable b shows that the transition to final state occurred.

trigger 1 example