A state machine has four components on the diagram: a While Loop, a Case Structure, an Enum constant, and a shift register.
- While Loop—Sets the outer boundary for the state machine code and facilitates state transitions.
- Case Structure—Contains a subdiagram for each state in the state machine.
- Shift register—Passes data from a completed state to the upcoming state.
- Enum constant—Contains a list of every state in the state machine. The state machine uses this constant to update the current
state transition value as the program executes.
Convert the Enum constant to a G Type and configure its list of values before using it in your state machine. This ensures that every Enum constant in your state machine has a consistent list of values that is easy to update.