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.
Pro missionStart, complete and reset
Test 1 of 17StatePhaseRunningPumpOnPump commandOFFValveCmdInlet valve commandOFFMixerOnMixer commandOFF- 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
What the tests check
- Every state sets all four outputs: pump, valve, mixer and Done.
- Held waits for Resume, and only once Hold is released.
- Abort or Stop works from every active state. Reset only works from Complete or Stopped/aborted.
- Try it Use the buttons below the model and watch the rig respond.
- Test solution Every check runs on your code in one press.
- Replay If one fails, step through it one scan at a time to see why.
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.
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.
- Ingredient tanksHold the water and syrup
- Mixing tankFill, mix and measure one batchYou are here
- Holding tankKeeps the finished drink ready
- 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.
Next in the course
- Add four measured valuesPractise arrays on four readings before you build a filter.Applied · 12 min · +150 XP
- Average the last N readingsSmooth a noisy level. Average only the readings you have, and drop the oldest.Applied · 25 min · +300 XP
- Describe one pump with a structureKeep a pump’s data together under one tag name.Applied · 12 min · +150 XP
- Call one block for two pumpsOne block, two copies, each with its own memory.Advanced · 20 min · +300 XP