Sequencer (output instruction)
SQO: Sequencer Output
Steps through a list of values, one per rung transition, for a sequencer built on a table.
Also called: drum sequencer, step table, sequencer.
SQO(number, steps, mask)Arguments
| Name | What it is | Accepts | Default |
|---|---|---|---|
| destination | What the instruction acts on | a register | required |
| steps | Step values | a list of whole numbers | 1,2,3 |
| mask | Mask | a number or a tag | -1 |
Arguments are positional and this table is generated from the simulator's own instruction registry, so it always matches what the engine accepts.
What it does
SQO is the electronic version of a mechanical drum sequencer: a rotating barrel with pegs on it, where each row of pegs closes a set of contacts and the barrel advances one position at a time. The list of values is the drum, each value is one position, and the bits within a value are the pegs.
It advances on the false to true transition of its own rung, wrapping back to the first position after the last. The position is readable as .POS and the number of steps as .LEN, and RES sends the position back to 0, which is the parked state before the first step.
The value at the current position is written into the destination register, and individual outputs are then decoded from its bits. A machine with four things to switch uses values built from 1, 2, 4 and 8, and reading the table down the page tells you what the machine does at every step, which is the real reason to use it: the sequence lives in one place instead of being spread over twenty rungs.
The mask decides which bits of the destination SQO owns. Bits outside the mask keep whatever they held, so a sequencer can share a register with something else.
A rung you can run
A three step light sequence on a self resetting timer
XIO(Step_Timer.DN)TON(Step_Timer,2000)
XIC(Step_Timer.DN)SQO(Light_Pattern,[4, 2, 1])
MEQ(Light_Pattern,4,4)OTE(Red_Light)
MEQ(Light_Pattern,2,2)OTE(Amber_Light)
MEQ(Light_Pattern,1,1)OTE(Green_Light)The first rung is the standard self resetting timer: its done bit is true for exactly one scan every two seconds, which is the edge the sequencer needs. The table holds 4, 2 and 1, which in bits are 100, 010 and 001, so one lamp is on at each step and each MEQ picks out its own bit. Run it and watch the lights walk round; add a fourth value to the list and the sequence gets a fourth step with no other change.
Run this rung in the simulatorWhat it is called on other controllers
| Platform | Equivalent |
|---|---|
| Rockwell (Studio 5000) | SQO |
| Siemens (TIA Portal) | No direct equivalent: a step number with a table, or GRAPH |
| Mitsubishi (GX Works) | No direct equivalent: step ladder instructions, or a table indexed by a step number |
| CODESYS and IEC 61131-3 | No direct equivalent: SFC, or an array indexed by a step |
Common mistakes
- Driving it from a level instead of an edge. SQO steps on the rung going from false to true, so a rung that is simply true never advances. Feed it a one shot, a timer done bit that resets itself, or a sensor edge.
- Forgetting that the position survives a stop. Restarting a machine mid sequence resumes wherever the drum was left, which is rarely what an operator expects. Reset it with RES on the start of a cycle, or on a home condition.
Practise it
Interactive exercises that use SQO. Each one checks your ladder against a real scan.
- Step SequenceA two-step batch cycle driven by step coils: press Start → FILL until the high level, then DRAIN until the low level, then done. This is how real machine sequences are structured: one coil per step, with clean hand-offs.
- FlasherTwo timers chained in a loop make a lamp blink: the classic two-TON flasher used for warning beacons everywhere. Your first taste of timers driving each other.
