Omron SYSMAC CP Series Instruction & Reference Manual page 138

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Function
i
TCMP(085) compares the source data (S) to each of
the 16 words T through T+15 and turns ON the corre-
sponding 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.
Sample program
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
D100
T
D200
D
D300
2-102
S
Comparison
S: D100
0 3 A 1
CP1E CPU Unit Instructions Reference Manual(W483)
1: Data are equal.
0: Data aren't equal.
Comparison
T
T+1
T+14
T+15
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
D214
D E F 0
D215
0 3 A 1
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
10
0
11
0
12
0
13
0
14
1
15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents