Compare - Cmp(32) - Omron SYSMAC mini SP10 Operation Manual

Table of Contents

Advertisement

Instruction Set
3-7-25

COMPARE - CMP(32)

Limitations
Description
Precautions
Flags
Example 1:
Saving CMP(32) Results
Ladder Symbol
CMP(32)
Cp1
Cp2
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.
Indirectly addressed DR word is non-existent. (Content of *DR word
ER:
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
Operand Data Areas
Cp1: First compare word
I/O, work, dedicated (03 only), DR, LR, TC, #
Cp2: Second compare word
I/O, work, dedicated (03 only), DR, LR, TC, #
Section 3-7
99

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SYSMAC mini SP10 and is the answer not in the manual?

This manual is also suitable for:

Sysmac mini sp16Sysmac mini sp20

Table of Contents