Yaskawa YASNAC PC NC PLC Programming Manual User Manual
Page 66

6 - 30
YASNAC PCNC PLC Programming Manual Chapter 6: PLC Instructions
(20)CPR (Compare Register) RR after operation: RR-
a) Function
The instruction executes comparison between R1 and R2 when the ST contact
is ON (RR = 1), and sets “0” or “1” to Z1 according to the result of comparison.
R1 < R2 Z1 = 0
R1
≥
R2 Z1 = 1
If the ST contact is OFF (RR = 0), the CPR instruction is not executed.The content
of RR remains at “0”.
(b) Format
(c) Explanation
•
After the execution of the CPR instruction, the contents of R1 and R2 remain
unchanged.
•
An ST contact must be entered before the CPR instruction.
•
The CPR instruction is executed in intervals of “4 × n” msec while the ST contact
is ON.
(d) Example
(21)COR (Coincide Register) RR after operation: RR-
(a) Function
The instruction executes comparison between R1 and R2 when the ST contact is ON
(RR = 1), and sets “0” or “1” to Z1 according to the result of comparison.
R1 = R2 Z1 = 0
R1
≠
R2 Z1 = 1
If the ST contact is OFF (RR = 0), the COR instruction is not executed. The content of
RR remains unchanged.
A B Paradym31 Variable Name