Menu
CoddyTech

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:

  1. wait for Start
  2. fill to High
  3. mix for 5 s
  4. 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 icon

Challenge

Hard
  • Steps 0 to 3: wait for Start, Fill to High, Mixer for 5 s, Drain until Level is below 100.
  • Stop sends 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
quiz iconTest yourself

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