Engineering · PLC · Project 7 of 15 · Sequences · Level 3
Two cylinders: A+ B+ B- A-
Cylinder A extends, then B extends, then B retracts, then A retracts. The classic pneumatic sequence.

You will learn
Each step waits for a sensor, not for time. The next movement only starts when the previous one has really finished, so the machine adapts if a cylinder is slow. Spring-return valves retract when their output turns off.
How it works
- Press START with both cylinders retracted.
- A+ then B+ then B- then A- run one after another.
- Each step waits for its sensor: A1, B1, B0, A0.
In real life
Pick-and-place units, stamping, clamping and packaging machines are built from sequences like this.
Inputs, outputs and addresses
The same signals on seven PLC brands. Inputs and outputs are numbered in order; check your own hardware and software, because addresses depend on the model and module position.
| Name | What it is | Type | Siemens S7-1200 | Allen-Bradley CompactLogix | Mitsubishi iQ-F FX5U | Delta DVP / AS | Omron CP2E | Schneider M241 | Inovance H5U |
|---|---|---|---|---|---|---|---|---|---|
| START | START push-button | Input | %I0.0 | Local:1:I.Data.0 | X0 | X0 | 0.00 | %IX0.0 | X0 |
| STOP | STOP push-button (N.C.) | Input | %I0.1 | Local:1:I.Data.1 | X1 | X1 | 0.01 | %IX0.1 | X1 |
| A0 | Cylinder A retracted sensor | Input | %I0.2 | Local:1:I.Data.2 | X2 | X2 | 0.02 | %IX0.2 | X2 |
| A1 | Cylinder A extended sensor | Input | %I0.3 | Local:1:I.Data.3 | X3 | X3 | 0.03 | %IX0.3 | X3 |
| B0 | Cylinder B retracted sensor | Input | %I0.4 | Local:1:I.Data.4 | X4 | X4 | 0.04 | %IX0.4 | X4 |
| B1 | Cylinder B extended sensor | Input | %I0.5 | Local:1:I.Data.5 | X5 | X5 | 0.05 | %IX0.5 | X5 |
| YA | Valve A (on = extend) | Output | %Q0.0 | Local:2:O.Data.0 | Y0 | Y0 | 100.00 | %QX0.0 | Y0 |
| YB | Valve B (on = extend) | Output | %Q0.1 | Local:2:O.Data.1 | Y1 | Y1 | 100.01 | %QX0.1 | Y1 |
Ladder diagram (shown for Siemens, live state)
Green wires carry power in the moment captured below. Switch the brand and the language in the simulator.
Sequential function chart
Structured text, Siemens SCL
(* Siemens S7-1200, CPU 1214C DC/DC/DC - TIA Portal - SCL *)
(* Variable "Step" (INT) holds the active step: 0 = idle *)
"YA" := FALSE;
"YB" := FALSE;
IF NOT "STOP" THEN
Step := 0; (* stop or emergency stop: back to idle *)
ELSE
CASE Step OF
0: (* idle *)
IF "START" AND "A0" AND "B0" THEN Step := 1; END_IF;
1: (* A extends (A+) *)
"YA" := TRUE;
IF "A1" THEN Step := 2; END_IF;
2: (* B extends (B+) *)
"YA" := TRUE;
"YB" := TRUE;
IF "B1" THEN Step := 3; END_IF;
3: (* B retracts (B-) *)
"YA" := TRUE;
IF "B0" THEN Step := 4; END_IF;
4: (* A retracts (A-) *)
IF "A0" THEN Step := 0; END_IF;
END_CASE;
END_IF;Structured text, Allen-Bradley
(* Allen-Bradley CompactLogix 5069 (L306ER) - Studio 5000 Logix Designer - Structured Text *)
(* Variable "Step" (INT) holds the active step: 0 = idle *)
YA := FALSE;
YB := FALSE;
IF NOT STOP THEN
Step := 0; (* stop or emergency stop: back to idle *)
ELSE
CASE Step OF
0: (* idle *)
IF START AND A0 AND B0 THEN Step := 1; END_IF;
1: (* A extends (A+) *)
YA := TRUE;
IF A1 THEN Step := 2; END_IF;
2: (* B extends (B+) *)
YA := TRUE;
YB := TRUE;
IF B1 THEN Step := 3; END_IF;
3: (* B retracts (B-) *)
YA := TRUE;
IF B0 THEN Step := 4; END_IF;
4: (* A retracts (A-) *)
IF A0 THEN Step := 0; END_IF;
END_CASE;
END_IF;Try this
- Watch the SFC tab while the cylinders move.
- Press STOP mid-cycle and see both retract.
Parts to buy
The links open a search on each store, so you see what is in stock today. Check the model, voltage and price before you order.
This is a learning tool. It teaches the logic, not the exact keystrokes of each vendor’s software. Check the manual of your own PLC.