7 Comparison Macros


Numerical values often need to be compared in PLC programs; typical examples are a batch counter saying the required number of items has been delivered, or alarm circuits indicating, for example, a temperature has gone above some safety level. These comparisons are performed by elements that have the generalized form of Figure 7.1, with two numerical inputs A and B corresponding to the values to be compared, and a Boolean (on/off) output that is true if the specified condition is met. The comparisons provided in this chapter are as follows:

A greater than B

(A > B)

A greater than or equal to B

(A > = B)

A equal to B

(A = B)

A less than B

(A < B)

A less than or equal to B

(A < = B)

A not equal to B

(A <> ...

Get Building a Programmable Logic Controller with a PIC16F648A Microcontroller now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.