Menu
CoddyTech

Mix a Batch

Part of the Analog and Sequences section of Coddy's PLC Programming journey. Lesson 9 of 17.

A batch is one full run of the sequence: fill, mix, drain, and back to idle, ready for the next Start.

The last step drains the tank until it is empty. The Low switch is not enough here: it goes FALSE at 20 %, with a quarter of the batch still in the tank. Use the analog input instead: in this tank Level reads 0 when it is empty. A real transmitter rarely reads exactly 0, so real programs compare against a small number instead, as you will in section 6.

The machine counts every batch that was filled to High and then emptied.

challenge icon

Challenge

Hard
  • after mixing, move 3 into Step instead of 0
  • in step 3, turn Drain on
  • when Level reads 0, move 0 into Step

Try it yourself

{"v":1,"lang":"ld","tags":[{"name":"Step","type":"INT"},{"name":"T1","type":"TON"}],"rungs":[{"els":[{"t":"cmp","op":"EQ","a":"Step","b":0},{"t":"no","tag":"Start"},{"t":"move","src":1,"dst":"Step"}]},{"els":[{"t":"cmp","op":"EQ","a":"Step","b":1},{"t":"no","tag":"High"},{"t":"move","src":2,"dst":"Step"}]},{"els":[{"t":"cmp","op":"EQ","a":"Step","b":2},{"t":"TON","inst":"T1","pt":"T#5s"},{"t":"move","src":0,"dst":"Step"}]},{"els":[{"t":"cmp","op":"EQ","a":"Step","b":1},{"t":"coil","tag":"Fill"}]},{"els":[{"t":"cmp","op":"EQ","a":"Step","b":2},{"t":"coil","tag":"Mixer"}]}]}

All lessons in Analog and Sequences

Practice on your own: PLC playground