Publication 1766-RM001A-EN-P - October 2008
Compare Instructions
193
MEQ - Mask Compare
for Equal
Instruction Type: input
The MEQ instruction is used to compare whether one value (source) is
equal to a second value (compare) through a mask. The source and the
compare are logically ANDed with the mask. Then, these results are
compared to each other. If the resulting values are equal, the rung state is
true. If the resulting values are not equal, the rung state is false.
For example:
The source, mask, and compare values must all be of the same data size
(either word or long word). The data ranges for mask and compare are:
•
-32,768…32,767 (word)
•
-2,147,483,648…2,147,483,647 (long word)
The mask is displayed as a hexadecimal unsigned value from 0000…FFFF
FFFF.
Addressing Modes and File Types can be used as shown in the following
table:
MEQ
Masked Equal
Source
N7:0
0<
Mask
N7:1
0000h<
Compare
N7:2
0<
MEQ
Execution Time for the MEQ Instructions
Controller
Data Size
When Rung Is:
True
False
MicroLogix 1400
word
6.2730 µs
0.1934 µs
long word
7.1602 µs
0.1780 µs
Source:
Compare:
1 1 1 1 1 0 1 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
Mask:
Mask:
1 1 0 0 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 0 1 1
Intermediate Result:
Intermediate Result:
1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0
Comparison of the Intermediate Results: not equal
MEQ Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page 92.
Parameter
Data Files
Function Files
(1)
CS - Comms
IOS - I/O
DLS - Da
ta
Lo
g
Address
Mode
(2)
Address Level
O
I
S
B
T,
C
, R
N
F
ST
L
MG, PD
RI/RIX
PLS
RTC
HSC
PTO
X
, PW
MX
STI
EII
BHI
MMI
LCD
Immediate
D
ir
ect
In
dir
ect
Bit
Wo
rd
Lo
ng W
o
rd
E
lemen
t
Source
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive