beautypg.com

Function, Sample program, 2 instructions – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 138

background image

2 Instructions

2-102

CP1E CPU Unit Instructions Reference Manual(W483)

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.

T

T+1

T+14

T+15

S

0

1

14

15

R

1: Data are equal.
0: Data aren’t equal.

Comparison

TCMP

D100

D200

D300

0.00

S

T

D

S: D100

Comparison

0

3

A

1

T: D200

D201

D202

D203

D204

D205

D206

D207

D208

D209

D210

D211

D212

D213

D214

D215

R: D300

0

2

A

1

0

0

0

0

0

1

2

0

0

3

A

1

0

0

0

0

0

2

A

1

1

2

3

4

5

6

7

8

9 A B C

D E F 0

0

3

A

1

1

2

3

4

5

6

7

8

9 A B C

D E F 0

0

3

A

1

0

0

0

1

0

0

0

0

0

0

1

0

0

0

0

1

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

This manual is related to the following products: