Engineering · PLC · Project 6 of 15 · Sequences · Level 3
Tank filling and mixing (SFC)
Fill with liquid A, fill with liquid B, stir for 5 seconds, then drain. A true step-by-step sequence.

You will learn
A sequence is a list of steps. Only one step is active at a time; it switches outputs on, and a transition condition moves on to the next step. In ladder each step is a memory bit; in Structured Text it becomes a CASE statement; in SFC it is drawn as boxes.
How it works
- Press START. Step 1 opens valve A until Level 1.
- Step 2 opens valve B until Level 2.
- Step 3 stirs for 5 s. Step 4 drains until empty, then the sequence returns to IDLE.
In real life
Batch plants in food, paint, chemicals and pharmaceuticals use this pattern, usually from a recipe table.
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 |
| L1 | Level 1 float (40 %) | Input | %I0.2 | Local:1:I.Data.2 | X2 | X2 | 0.02 | %IX0.2 | X2 |
| L2 | Level 2 float (80 %) | Input | %I0.3 | Local:1:I.Data.3 | X3 | X3 | 0.03 | %IX0.3 | X3 |
| L0 | Empty float (above 3 %) | Input | %I0.4 | Local:1:I.Data.4 | X4 | X4 | 0.04 | %IX0.4 | X4 |
| VA | Valve A | Output | %Q0.0 | Local:2:O.Data.0 | Y0 | Y0 | 100.00 | %QX0.0 | Y0 |
| VB | Valve B | Output | %Q0.1 | Local:2:O.Data.1 | Y1 | Y1 | 100.01 | %QX0.1 | Y1 |
| MIX | Mixer motor | Output | %Q0.2 | Local:2:O.Data.2 | Y2 | Y2 | 100.02 | %QX0.2 | Y2 |
| DRAIN | Drain valve | Output | %Q0.3 | Local:2:O.Data.3 | Y3 | Y3 | 100.03 | %QX0.3 | Y3 |
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 *)
"T3"(IN := Step = 3, PT := T#5s);
"VA" := FALSE;
"VB" := FALSE;
"MIX" := FALSE;
"DRAIN" := FALSE;
IF NOT "STOP" THEN
Step := 0; (* stop or emergency stop: back to idle *)
ELSE
CASE Step OF
0: (* idle *)
IF "START" THEN Step := 1; END_IF;
1: (* Fill with A *)
"VA" := TRUE;
IF "L1" THEN Step := 2; END_IF;
2: (* Fill with B *)
"VB" := TRUE;
IF "L2" THEN Step := 3; END_IF;
3: (* Mix *)
"MIX" := TRUE;
IF "T3".Q THEN Step := 4; END_IF;
4: (* Drain *)
"DRAIN" := TRUE;
IF NOT "L0" 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 *)
Timer3.PRE := 5000; (* ms *)
Timer3.TimerEnable := Step = 3;
TONR(Timer3);
VA := FALSE;
VB := FALSE;
MIX := FALSE;
DRAIN := FALSE;
IF NOT STOP THEN
Step := 0; (* stop or emergency stop: back to idle *)
ELSE
CASE Step OF
0: (* idle *)
IF START THEN Step := 1; END_IF;
1: (* Fill with A *)
VA := TRUE;
IF L1 THEN Step := 2; END_IF;
2: (* Fill with B *)
VB := TRUE;
IF L2 THEN Step := 3; END_IF;
3: (* Mix *)
MIX := TRUE;
IF Timer3.DN THEN Step := 4; END_IF;
4: (* Drain *)
DRAIN := TRUE;
IF NOT L0 THEN Step := 0; END_IF;
END_CASE;
END_IF;Try this
- Open the SFC tab and watch the active step light up.
- Press STOP in the middle: everything returns to IDLE and the valves close.
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.