



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of comparison and math instructions in programmable logic controllers (plcs). It covers various comparison instructions such as equal (equ), not equal (neq), less than (les), less than or equal (leq), greater than (grt), greater than or equal (geq), masked comparison for equal (meq), and limit test (lim). The document also explains the use and logic of each instruction, as well as the role of source and destination addresses. Additionally, it discusses the arithmetic status bits and their updates after an instruction is executed.
Typology: Slides
1 / 7
This page cannot be seen from the preview
Don't miss anything!




Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
Instruction Purpose Mnemonic Name EQUQU Equalqua Test whether two values are equalest et e t o a ues a e equa NEQ Not Equal Test whether one value is not equal to a second value LES Less Than Test whether one value is less than a second value LEQ Less Than or Equal
Test whether one value is less than or equal to a second value GRT Greater Than Test whether one value is greater than another
Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
GEQ Greater Than or Equal
Test whether one value is greater than or equal to a second value MEQ Masked Comparison for Equal
Test portions of two values to see whether they are equal. Compares data through a mask LIM Limit Test Test whether one value is within the limit range of two other values
Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
p
Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
parameters must be word addresses.
Example, low limit less than high limit:
Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
Low Limit High Limit Instruction is True when Test value is
Instruction is False when Test value is 5 8 5 through 8 -32768 through 4 and 9 through 32767
Example, high limit less than low limit:
Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
Low Limit High Limit Instruction is True when Test value is
Instruction is False when Test value is 8 5 -32768 through 5 and 8 through 32767
6 through 7
With this bit: The Controller:
S:0/0 Carry (C) sets if carry is generated; otherwise cleared
S:0/1 Overflow (V) indicates that the actual result of a math instruction does not fit in the designated d ti ti
Electrical & Computer Engineering Dr. D. J. Jackson Lecture 7-
destination
S:0/2 Zero (Z) indicates a 0 value after a math, move, or logic instruction S:0/3 Sign (S) indicates a negative (less than 0) value after a math, move, or logic instruction