From the course: Learning PLC Ladder Logic: 2 Diving Deeper

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Comparison instruction

Solution: Comparison instruction - Ladder Logic Tutorial

From the course: Learning PLC Ladder Logic: 2 Diving Deeper

Start my 1-month free trial

Solution: Comparison instruction

- [Instructor] For the first rung, we are going to use a counter up to count the number of parts. And the proximity sensor is an input. Every time a part passes by the quality control line, the counter counts up. Now, the tag we are going to use in the compare instruction is the counter accumulated value, because we want to use the current number of parts. If the accumulated value is less than eight, then a green pilot light turns on. If the accumulated value equals eight, then a red pilot light turns on. Now, we need to add the reset pushbutton for the counter. Remember that counter needs a reset instruction to reset it back to zero. We can also add another compare instruction, less than, in the first rung. This is used to prevent the counter from exceeding the preset value. So, as long as the accumulated value is less than the preset, the counter keeps counting. As soon as the accumulated value equals the preset,…

Contents