← All exercises

Single-Trigger Sequencer

medium

Advances through three steps using one shared Next button.

What it teaches

Your first explicit state sequencer: one state number, three mutually exclusive active-step flags, and one shared edge-triggered input that advances every step. The manual-advance skeleton — an operator stepping a machine through setup positions one press at a time.

Inputs and outputs

TagTypeDefaultDescription
In_NextBOOLEach press advances to the next step
In_ResetBOOLReturns the sequencer to Idle
Sts_Step1ActiveBOOL1 only while step 1 is active
Sts_Step2ActiveBOOL1 only while step 2 is active
Sts_Step3ActiveBOOL1 only while step 3 is active
Sts_StepDINT0=Idle, 1=Step1, 2=Step2, 3=Step3

Required behavior