Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 304

Table of Contents

Advertisement

3. Instructions
Function
TCMP(085) compares the source data (S) to each of
the 16 words T through T+15 and turns ON the
corresponding bit in word R when the data are equal.
Bit n of R is turned ON if the content of T+n is equal
to S and it is turned OFF if they are not equal.
S is compared to the content of T and bit 00 of R is
turned ON if they are equal or OFF if they are not
equal, S is compared to the content of T+1 and bit 01
of R is turned ON if they are equal or OFF if they are
not equal, ..., and S is compared to the content of
T+15 and bit 15 of R is turned ON if they are equal or OFF if they are not equal.
Example Programming
When CIO 0.00 is ON in the following example, TCMP(085) compares the content of D100 with the
contents of words D200 through D215 and turns ON the corresponding bits in D300 when the contents
are equal or OFF when the contents are not equal.
0.00
TCMP
S
T
D
268
S: D100
0 3 A 1
D100
D200
D300
Comparison
S
T
T+1
T+14
T+15
Comparison
T: D200
0 2 A 1
D201
0 0 0 0
D202
0 1 2 0
D203
0 3 A 1
D204
0 0 0 0
D205
0 2 A 1
D206
1 2 3 4
D207
5 6 7 8
D208
9 A B C
D209
D E F 0
D210
0 3 A 1
D211
1 2 3 4
D212
5 6 7 8
D213
9 A B C
D E F 0
D214
D215
0 3 A 1
CS/CJ/NSJ Series Instructions Reference Manual (W474)
1: Data are equal.
0: Data aren't equal.
R
0
1
14
15
R: D300
0
0
0
1
0
2
1
3
0
4
0
5
0
6
0
7
0
8
0
9
1
1 0
0
1 1
0
1 2
0
1 3
0
1 4
1
1 5

Advertisement

Table of Contents
loading

Table of Contents