Skip to main content
Call Eric:863-698-8266
CURRYCONTROLS.COMControls & Automation Knowledge Hub
ReferencePLCProgrammingControlWaterWastewater

Sequencers

Step-based control for operations that always run in the same order: backwash, pump and valve startup, batch makeup, membrane cleans. What every step needs, three ways to implement one, handling faults and power loss mid-sequence, and what the HMI shows.

10 min readUpdated Sep 5, 2026Published Sep 5, 2026By Eric Sullivan

The short answer

Sequencers

A sequencer moves a piece of equipment through a fixed series of steps, each with the actions it performs, the condition that completes it, a timeout, and a defined response to a fault. It is implemented as an integer step number with a case structure, a drum or sequencer output instruction for fixed output patterns, or a sequential function chart where the platform supports it. Every step has a timeout with an alarm, transitions are driven by feedback rather than assumed, faults either hold the sequence or abort it to a safe state as the functional description decides, and after a power loss the sequence restarts from a recovery step that evaluates the plant rather than from wherever it was.

Key points

  • Fixed order, one active step, feedback-driven transitions: that is a sequencer. Arbitrary transitions are a state machine.
  • Every step has a number, a name, actions, a completion condition, a timeout, and a fault response.
  • Integer step and case structure runs on any platform and is the easiest to read in the field.
  • Timeouts with alarms turn a stuck sequence into a diagnosed one: the alarm names the step and what it was waiting for.
  • Hold keeps outputs and waits; abort drives outputs to a safe state. Decide per step, in the functional description.
  • After a power loss the sequence goes to a recovery step, never straight back to the step it was in.

What a sequencer is for

Some operations always happen in the same order. A filter backwash closes the influent valve, drains to a level, air scours, washes, settles, filters to waste, and returns to service. A high-service pump start pre-lubricates, opens the suction valve, starts the motor, and opens the discharge valve slowly. A polymer batch fills to a level, adds neat polymer for a time, mixes, and ages. Each of these is a list of steps, and the controller code that runs them is a sequencer. The alternative, a tangle of timers and latches that happens to produce the right order, works until someone has to change step four.

What every step needs

Number and name
Numbered by tens so a step can be inserted later; named in the words the operators use. Step 30, Air Scour.
Actions
The outputs held while the step is active: valves open, blower running. Outputs not named are in their default state.
Completion condition
Feedback, not assumption: a valve limit switch, a level, a flow, an analyzer reading, or a timer where time is the only measure. A step that waits for a valve to open watches the open limit, not a five-second timer.
Timeout
The longest the step may take before something is wrong, with an alarm that names the step and the condition it was waiting for.
Fault response
Hold, abort, or retry, decided per step. A timeout on the drain step may hold and wait for the operator; a timeout on the discharge valve during a pump start aborts and stops the pump.
Manual advance
A supervisor-level button that forces the transition, for commissioning and for the day a limit switch is broken, logged when used.

Three ways to build one

MethodHow it worksBest forWatch out for
Integer step with case structureA step register holds the current step; a case statement or a set of equal-compare rungs runs the logic for that step and sets the next step numberAnything; readable on every platform; easy to add stepsEvery write to the step register must be in one place, or two rungs fight over it
Drum or sequencer output instructionA table of output patterns indexed by step, advanced by time or by an event inputFixed output patterns such as wash cycles and simple valve sequencesConditions and timeouts live outside the instruction; harder to see what is waiting
Sequential function chartGraphical steps and transitions with actions attached; parallel branches supportedLong sequences with parallel paths, on platforms and with staff that know itNot every platform has it; a field technician who has never seen one cannot troubleshoot it at 2 a.m.

Example: filter backwash

StepActionsCompletionTimeoutOn timeout
0 IdleFilter in serviceBackwash request and permissives truenonenone
10 IsolateClose influent valve, close effluent valveBoth closed limits2 minAbort, alarm valve
20 Drain downOpen drain or waste valveLevel below air scour level30 minHold, alarm
30 Air scourOpen air valve, start blowerTimer, typically a few minutestimer + 1 minAbort, alarm blower
40 Air and waterStart wash pump at low rate with airTimertimer + 1 minAbort
50 Water washStop blower, close air valve, wash pump to high rateTimer, or waste turbidity below setpointtimer + 2 minHold, alarm
60 SettleStop wash pump, close wash valvesClosed limits, settle timer5 minAlarm valve
70 Filter to wasteOpen influent, open waste valveEffluent turbidity below setpointPer the plantHold, alarm
80 ReturnClose waste valve, open effluent valveEffluent open limit2 minAlarm valve
Step times and setpoints come from the functional description and the plant; the structure is the point

Coding pattern

Structured text case structure; each step owns its outputs, its transition, and its timeout
CASE BW_Step OF
  10: (* Isolate *)
      FV_Influent_Close := TRUE;  FV_Effluent_Close := TRUE;
      IF ZSC_Influent AND ZSC_Effluent THEN BW_Step := 20; END_IF;
      IF BW_StepTimer.ET > T#2m THEN BW_Fault := TRUE; BW_Step := 900; END_IF;

  20: (* Drain down *)
      FV_Waste_Open := TRUE;
      IF LT_Filter_PV < BW_ScourLevel THEN BW_Step := 30; END_IF;
      IF BW_StepTimer.ET > T#30m THEN BW_Hold := TRUE; END_IF;  (* hold, alarm *)

  30: (* Air scour *)
      FV_Air_Open := TRUE;  Blower_RunCmd := TRUE;
      IF BW_StepTimer.ET > BW_ScourTime THEN BW_Step := 40; END_IF;

  (* ... *)

  900: (* Abort: safe state *)
      Blower_RunCmd := FALSE;  WashPump_RunCmd := FALSE;
      FV_Air_Open := FALSE;    FV_Waste_Open := FALSE;
      IF BW_Reset THEN BW_Fault := FALSE; BW_Step := 0; END_IF;
END_CASE;

(* Step timer restarts on any step change; step number written only inside the CASE *)

Two disciplines keep this readable for years. The step number is written only inside the case structure, so there is exactly one place to look for how the sequence advances. And outputs are set inside the step that uses them and cleared in a common section that runs when the step changes, so a step cannot leave a valve open by forgetting to close it.

Faults, holds, and power loss

A hold freezes the sequence in its current step with outputs as they are, and waits for an operator to resume, advance, or abort. It fits steps where waiting is safe, such as a drain that is slow because the waste line is restricted. An abort drives every output the sequence controls to a defined safe state and goes to an abort step that waits for a reset. It fits steps where waiting is not safe, such as a blower running against a closed valve. The functional description says which applies to each step; the code should not guess.

Power loss in the middle of a sequence is the case that gets forgotten. If the step number is retentive, the controller powers up in step 50 with the wash pump commanded to run and the valves in whatever positions they drifted to. If it is not retentive, the sequence restarts at idle with the filter half drained and the influent valve closed, and the filter sits there. The robust answer is a recovery step: on first scan, the sequence goes to a step that reads the valve positions and level, alarms that a sequence was interrupted, and either returns to idle safely or lets the operator choose where to resume.

What the HMI shows

  • The current step number and name, in the same words as the functional description.
  • The step timer and the timeout, so a slow step is visible before it alarms.
  • The condition the step is waiting for, as text: Waiting for influent valve closed limit.
  • Start, hold, resume, abort, and the supervisor-level advance, each logged.
  • The last completed sequence with its total time and any holds, and a trend of step durations over time; a wash that takes longer every week is telling you something.

Frequently asked questions

What is the difference between a sequencer and a state machine?
A sequencer runs a fixed list of steps in order and returns to idle; the only branches are hold and abort. A state machine has a set of states with transitions in any direction, such as a pump that moves between stopped, starting, running, stopping, and failed. Use a sequencer for an operation with a beginning and an end, and a state machine for equipment that lives in modes.
Where do the step times come from?
From the functional description, which got them from the process designer, the equipment manufacturer, and the plant. Put them in setpoint registers with limits, editable from a supervisor screen, never as constants in the code. A wash duration that has to be changed by a programmer is a wash duration that never gets optimized.
Can two sequences run at the same time?
Two sequences on different equipment, yes; each has its own step register and code. Two filters backwashing at once is a process question, and usually the answer is a permissive that lets only one backwash run at a time because the wash supply and the waste handling are sized for one.
How do I test a sequence without running the plant?
With the outputs disabled or the equipment isolated, step through it with simulated feedback: force the limit switches and levels in the order the sequence expects, then in the wrong order, then not at all, and confirm every timeout and abort behaves. Then run it once for real with someone at the equipment. Sequences that were only tested on the happy path fail on the first unhappy one.

Direct contact

Have a controls question?

Reach Eric Sullivan directly about anything on this site, a controls or automation topic, or one of his personal projects.