MEQ ( Masked Comparison for Equal)

Break the mask out into binary first:
0000 1111 1111 1111 (I am going to assume the "d" was a typo, let me know if this is not the case)

Now look at the instruction like this:
Code:
Source:    0000 0000 0000 000[COLOR="Red"]0[/COLOR]
Mask:      0000 1111 1111 1111
Compare:   1111 1111 0111 110[COLOR="red"]1[/COLOR]
Now take each column individually, and if there is a 1 in the mask location, the source and the compare must be equal in order for the MEQ instruction to evaluate true. If the mask position is zero, then the MEQ "doesn't care" about that position.

In your example, right off the bat, we see that the least significant bits are not equal and they are "masked in" to the instruction, so you know it evaluates false without having to go any further.

Assuming the "d" in the mask was not a typo, but leaving out the leading zero:
Code:
Source:    0000 0000 0000 000[COLOR="Red"]0[/COLOR]
Mask:      1111 1111 1111 1101
Compare:   1111 1111 0111 110[COLOR="red"]1[/COLOR]

An instructor once explained it this way: If there's a big fat zero in the mask, the values from the source can't fall through to be compared, so ignore those. if there's a skinny little "1" in the mask, then the number in the source can "fall through" to be compared.
 
Last edited:
...
An instructor once explained it this way: If there's a big fat zero in the mask, the values from the source can't fall through to be compared, so ignore those. if there's a skinny little "1" in the mask, then the number in the source can "fall through" to be compared.

This reminds me old Russian student jokes, explaining why a capacitor conducts AC but not DC.

Capacitor Jokes.jpg
 
Last edited:

Similar Topics

can anyone explain to me why, in this wiring diagram the solenoid connection is not shown? Is it just up to the electrician to decide on his own...
Replies
1
Views
1,427
I have to upgrade an old telemeq TSX 47 30 PLC to Unity Pro during Xmas shutdown. I have the back up of the telemeq PLC. COuld some one please...
Replies
13
Views
6,406
What's the difference or benefits of using a "MASKED EQUAL" compared to using "AND" instruction? A "MASKED EQUAL" instruction is basically an...
Replies
5
Views
3,983
SLC505 Processor. On a packing line we are using scanners to read a content SKU label on one side of the carton and another scanner to read the...
Replies
20
Views
3,435
Hello, I am using a UDT to track status from two different indexing lines that merge into one. Essentially, one indexing line is the part, and...
Replies
17
Views
3,708
Back
Top Bottom