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

Introduction to comparison instructions - Ladder Logic Tutorial

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

Introduction to comparison instructions

- [Instructor] When working with a programming ladder logic, you may run into a situation where you need to compare numerical quantities, like if the temperature reached the specific value. A data compare instruction is used to compare two values. It is an input block-type instruction with two sources only, Source A, and Source B. Since it's an input, so the instruction is added to the left-hand side of the rung where inputs are placed. It compares two values and produces a discrete logic output based on the comparison. And remember that our rung must have an output, so we'll have an output for that specific rung. The two sources are Read-only, so they do not change. The instruction is to compare any two values stored in the data register table, so two tags from the tag table, or compare a value stored in the register, the tag table, with a constant. If the comparison instruction is true, then the whole block instruction is set true, which means whatever it's connected to turns on. Otherwise, it will remain false.

Contents