Comparison Instructions
Flags
7-19 Comparison Instructions
7-19-1 COMPARE – CMP(20)
Limitations
Description
Precautions
Flags
432
If the period is short and hunting occurs, it may be that the control system re-
sponse is quick and the derivative action is too strong. In that case, set the de-
rivative action lower.
Control by measured PID
(when hunting occurs in a short period)
SV
Lower D.
ER:
There is an error in the parameter settings.
The cycle time is more than twice as long as the sampling period, so
PID(––) cannot be executed accurately. PID(––) will be executed in this
case.
P1 and P1+32 are not in the same area or a parameter setting is not
within the specified range.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
CY:
ON when PID processing is being performed. (OFF when the sampling
period has not elapsed.)
Ladder Symbols
CMP(20)
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(20) is not executed. When the
execution condition is ON, CMP(20) compares Cp1 and Cp2 and outputs the
result to the GR, EQ, and LE flags in the SR area.
Placing other instructions between CMP(20) and the operation which accesses
the EQ, LE, and GR flags may change the status of these flags. Be sure to ac-
cess them before the desired status is changed.
Indirectly addressed DM word is non-existent. (Content of *DM word is
ER:
not BCD, or the DM 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.
Flag
Address
GR
25505
EQ
25506
LE
25507
Operand Data Areas
Cp1: First compare word
IR, SR, AR, DM, HR, TC, LR, #
Cp2: Second compare word
IR, SR, AR, DM, HR, TC, LR, #
C1 < C2
C1 = C2
OFF
OFF
OFF
ON
ON
OFF
Section
7-19
C1 > C2
ON
OFF
OFF
Need help?
Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?