
99
3-7-25
COMPARE - CMP(32)
Cp1: First compare word
I/O, work, dedicated (03 only), DR, LR, TC, #
Ladder Symbol
Operand Data Areas
CMP(32)
Cp1
Cp2
Cp2: Second compare word
I/O, work, dedicated (03 only), DR, LR, TC, #
When comparing a value to the PV of a timer or counter, the value must be in
BCD.
When the execution condition is OFF, CMP(32) is not executed. When the
execution condition is ON, CMP(32) compares Cp1 and Cp2 and outputs the
result to the GR, EQ, and LE flags in the dedicated area.
Placing other instructions between CMP(32) and the operation which ac-
cesses the EQ, LE, and GR flags may change the status of these flags. Be
sure to access them before the desired status is changed.
ER:
Indirectly addressed DR word is non-existent. (Content of
*
DR word
is not BCD, or the DR area boundary has been exceeded.)
EQ:
ON if Cp1 equals Cp2.
LE:
ON if Cp1 is less than Cp2.
GR:
ON if Cp1 is greater than Cp2.
The following example shows how to save the comparison result immediate-
ly. If the content of 01 is greater than that of DR 09, 0100 is turned ON; if the
two contents are equal, 0101 is turned ON; if content of 01 is less than that of
DR 09, 0102 is turned ON. In some applications, only one of the three OUTs
would be necessary, making the use of TR 0 unnecessary. With this type of
Limitations
Description
Precautions
Flags
Example 1:
Saving CMP(32) Results
Instruction Set
Section 3-7