Skip to content
PLCampus
All examples

11Level 4

Batch mixer in SFC

A classic sequence: load ingredient A, then B, mix for 8 seconds and drain. It is written in SFC (steps and transitions chart), the language designed precisely for step-by-step processes.

The simulator is designed for computers (screens 1024 px or wider).

Virtual plant

A · Q0.0B · Q0.10 %MQ0.2I0.3I0.2I0.4Q0.3Q0.4Ingredient A: 0 %Ingredient B: 0 %Mixing: 0 of 8 sGood batches: 0Bad batches: 0

Good batches: 0. Bad batches: 0

Shown at rest. In the simulator the plant moves according to your program's outputs.

Inputs and outputs

AddressNameDescription
I0.0STARTStart batch push button
I0.1STOPStop push button (NC: 1 at rest); prevents starting a batch
I0.2LEVEL_AIngredient A level switch, 40 % (plant)
I0.3FULLTank full switch, 80 % (plant)
I0.4EMPTYTank empty switch (plant)
Q0.0VALVE_AIngredient A valve
Q0.1VALVE_BIngredient B valve
Q0.2AGITATORAgitator motor
Q0.3DRAIN_VALVEDrain valve
Q0.4BATCH_DONEBatch done light (stays on until the next batch)

Program

Sequential function chart (SFC)

IDLEFILL_ANVALVE_ARBATCH_DONEFILL_BNVALVE_BMIXNAGITATORDRAINNDRAIN_VALVESBATCH_DONESTART AND STOP AND EMPTYLEVEL_AFULLMIX.T >= T#8s→ IDLEEMPTY

Step by step

  1. 1Press ▶ Run (F5). The initial step IDLE (double border) becomes active by itself. Press START: the transition is true because the tank is empty and STOP is at rest.
  2. 2FILL_A opens VALVE_A (action N: only while the step is active) and turns BATCH_DONE off (R). At 40 %, LEVEL_A makes the transition true and moves on to FILL_B, which fills up to FULL.
  3. 3MIX turns the agitator on. Its transition uses the step time: MIX.T >= T#8s. Watch the time run inside the active step.
  4. 4DRAIN opens the outlet and turns BATCH_DONE on with S (it stays on). With the tank empty it returns to IDLE (the arrow → IDLE is a jump). The plant grades each batch: try lowering the mixing time to T#3s and you will get a bad batch.