Chapter 6 Instruction Details
XBC E-Type Main Unit 6-119 Ve r. 1
6.22.3 TCMP, TCMPP, DTCMP, DTCMPP
Instruction
Step
P M K F L T C S Z D.x
R.x
U N D R
TCMP(P)
DTCMP(P)
4~6 O - -
Data or Data address to compare with S2
S2 Data address to compare with S1 WORD/DWORD
Area (1 Word) to save the result of compared S1 and S2
[Flag Set]
Flag Description
Error
The value of ‘S2 area + 15 (WORD/DWORD)’ exceeded range of applicable
device.
F110
1) TCMP (Table Compare)
(1) Compares specified Compare Data S1 with 16-word data starting S2 to output to specified D area’s 16 bits
(‘1‘ if identical, ‘0’ if different).
(2) S1 sets word data or data address, and S2 sets table head area address.
2) Program Example
(1) If Input Signal P00020 is On, it compares Data ‘h0057’ saved in D0000 to 16-word data from D0002. And
compared result ‘5’ is saved in P0006.
TCMP D0000 D0002
P
0006
P
00020
D
0000
Comparison
Data
(S1)
h0057
h0057
h1234
h0057
h3456
h7893
h1252
h3452
h4523
h0024
h3451
D0002
D0004
D0007
D0014
D0017
(S2)
5
P0006
(D)