Outputting A Comparison Result Of 16-Bit Binary Data - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Outputting a comparison result of 16-bit binary data

CMP(P)(_U)
RnPCPU
RnCPU RnENCPU
(Process)
• The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.)
These instructions compare the 16-bit binary data specified by (s1) with the 16-bit binary data specified by (s2), and according
to the result (small, equal, or large), (d), (d)+1, or (d)+2 is turned on.
Ladder
(s1)
FBD/LD
EN
ENO
s1
d
s2
■Execution condition
Instruction
CMP
CMP_U
CMPP
CMPP_U
Setting data
■Description, range, data type
Operand
(s1)
CMP(P)
CMP(P)_U
(s2)
CMP(P)
CMP(P)_U
(d)
EN
ENO
6 BASIC INSTRUCTIONS
222
6.1 Comparison Operation Instructions
RnPCPU
RnSFCPU RnSFCPU
(Redundant)
(Standard)
(Safety)
(s2)
(d)
Execution condition
Description
Comparison data or the device where the
comparison data is stored
Comparison data or the device where the
comparison data is stored
The start device where the comparison result is
stored
Execution condition
Execution result
ST
ENO:=CMP(EN,s1,s2,d);
ENO:=CMPP(EN,s1,s2,d);
Range
Data type
-32768 to 32767
16-bit signed binary
0 to 65535
16-bit unsigned binary
-32768 to 32767
16-bit signed binary
0 to 65535
16-bit unsigned binary
Bit
Bit
Bit
ENO:=CMP_U(EN,s1,s2,d);
ENO:=CMPP_U(EN,s1,s2,d);
Data type (label)
ANY16_S
ANY16_U
ANY16_S
ANY16_U
ANYBIT_ARRAY
(Number of elements: 3)
BOOL
BOOL

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents