Menu
CoddyTech

Count the Boxes

Part of the Counters and Numbers section of Coddy's PLC Programming journey. Lesson 11 of 17.

The line wants to know how many boxes went out. The Eye near the end of the belt is TRUE while a box passes it, so each box gives it one rising edge: exactly what a CTU counts.

Count at the Eye, not at Entry. A box that has passed the Eye is done; a box at Entry still has the whole belt ahead of it.

challenge icon

Challenge

Medium

Count each box that reaches the Eye with a CTU (PV 9999), and show the count on Display. Keep the belt rungs.

Try it yourself

{"v":1,"lang":"ld","tags":[],"rungs":[{"els":[{"t":"par","branches":[[{"t":"no","tag":"Start"}],[{"t":"no","tag":"Belt"}]]},{"t":"no","tag":"Stop"},{"t":"coil","tag":"Belt"}]},{"els":[{"t":"no","tag":"Belt"},{"t":"coil","tag":"Lamp"}]}]}

All lessons in Counters and Numbers

Practice on your own: PLC playground