Loading local progress…
Practice missions
Practise in
Level 1, 0 XP · your progress
Mission 30 · Pro Structured Text state machine exercise

Run, hold and recover a phase

Use a numbered state to run, pause and safely restart a mixing job.

Run a mix-and-transfer job with a CASE statement. State is a whole number (a ) that says which step the job is in. Change State at most once per , one pass through your code. Abort and Stop beat Hold, and Hold beats finishing. On the scan where State changes, the may match the old state or the new one. From the next scan, they must match the new state. The states are loosely based on ISA-88 batch phases, not the full ISA-88 model.

This mission is part of ProTry the full course, every mission and the expert challenges free for 7 days. No card needed.
The 3D process tank this mission runs on Pro mission
Test replay

Start, complete and reset

Test 1 of 17
Set by the testChecked by the testStep 9 of 9 · 460 ms
Level
Advanced
Time
About 25 min
Reward
+300 XP
Rig
3D process tank
Siemens editors
SCL
Rockwell editors
Structured Text
Course stage
16. Write phases in text
Automatic tests

What the tests check

  1. Every state sets all four outputs: pump, valve, mixer and Done.
  2. Held waits for Resume, and only once Hold is released.
  3. Abort or Stop works from every active state. Reset only works from Complete or Stopped/aborted.
  1. Try it Use the buttons below the model and watch the rig respond.
  2. Test solution Every check runs on your code in one press.
  3. Replay If one fails, step through it one scan at a time to see why.
Why it matters

Where you’d see this on site

A factory mixer can be running, held or finished. An engineer needs to see which state it is in before restarting it.

If the state is unclear, a pump can keep running during a hold. A restart that nobody chose can send liquid into an unfinished batch.

Where you'd find thisMaking one batch of drink

At a drinks factory, valves let measured amounts of water and syrup into a mixing tank. An electric mixer blends them into one batch. An outlet valve then sends the drink to a holding tank. Filling machines bottle it from there.

  1. Ingredient tanksHold the water and syrup
  2. Mixing tankFill, mix and measure one batchYou are here
  3. Holding tankKeeps the finished drink ready
  4. Bottle fillerPuts the drink into bottles
On a real site: places, parts and safety
  • Drinks factory — blending water and syrup
  • Paint factory — mixing ingredients into a consistent colour
  • Water-treatment works — preparing a measured chemical mixture
  • Brewery — heating water for washing equipment

A full tank does not close its own inlet. Water keeps arriving until the valve closes, so an open inlet can flood the room.

A heater that is not covered by liquid can overheat. Real tanks have separate safety devices as well as the PLC programme.

The sizes, timings and cutaways are teaching choices, not a drawing of any one real installation.

Keep going

Next in the course