Project: Batch in Text
Part of the Structured Text section of Coddy's PLC Programming journey. Lesson 17 of 17.
The mixing tank batch from section 5, written as text. One CASE holds the whole recipe:
- wait for Start
- fill to High
- mix for 5 s
- drain until the tank is empty
The Low switch is at 20 %, too high to tell you the tank is empty. Use the analog input: Level below 100 (raw) is about 0.3 %, as good as empty.
Stop must work in every step. Put one IF after the CASE that sends Step back to 0: it runs last, so it wins, and every output turns off because the outputs follow the step.
Challenge
Hard- Steps 0 to 3: wait for
Start,FilltoHigh,Mixerfor 5 s,DrainuntilLevelis below 100. Stopsends the tank to step 0 at any time.- The outputs follow the step, after the CASE.
Try it yourself
VAR
Step : INT;
MixTime : TON;
END_VAR
// The mix timer
// The CASE: steps 0 to 3
// Stop
// The outputs
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Structured Text
Practice on your own: PLC playground