Delta AS Series Programming Manual page 304

Hide thumbs Also See for AS Series:
Table of Contents

Advertisement

API
Instruction code
0054
D
CMP
Device
X
Y
M
S
1
S
2
D
Data
type
S
1
S
2
D
Symbol
Explanation
1.
These instructions compare the single decimal numbers in S
2.
The operand D occupies 3 consecutive devices. The comparison results are stored in D, D+1, and D+2. If the
value in S
is greater than the value in S
1
value in S
is less than the value in S
1
3.
Only the DCMP and DCMPP instructions can use the 32-bit counter, but not the device E.
Example
1.
If the operand D is M0, the comparison results are stored in M0, M1 and M2, as shown below.
2.
When X0.0 is ON, the CMP instruction is executed. M0, M1, or M2 is ON. When X0.0 is OFF, the execution of the
CMP instruction stops and the state of M0, the state of M1, and the state of M2 remain unchanged.
Operand
,S
,D
P
S
1
2
S
T
C
HC
Pulse Instruction
S1 : Comparison value1
S2 : Comparison value2
: Comparison result
D
, D is ON. If the value in S
2
, D+2 is ON.
2
C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s
D
FR
SM
SR
16-bit instruction
AS
AS
and S
and store the comparison results in D.
1
2
is equal to the value in S
1
Function
Comparing values
E
K
16#
"$"
F
32-bit instruction
AS
, D+1 is ON. If the
2
6 - 2 5
6_

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents