147
The following example shows the comparisons made and the results pro-
vided for BCMP(68). Here, the comparison is made during each cycle when
00000 is ON.
CD 001 Lower limits Upper limits R: HR 05
001 0210 HR 10 0000 HR 11 0100 HR 0500 0
HR 12 0101 HR 13 0200 HR 0501 0
HR 14 0201 HR 15 0300 HR 0502 1
HR 16 0301 HR 17 0400 HR 0503 0
HR 18 0401 HR 19 0500 HR 0504 0
HR 20 0501 HR 21 0600 HR 0505 0
HR 22 0601 HR 23 0700 HR 0506 0
HR 24 0701 HR 25 0800 HR 0507 0
HR 26 0801 HR 27 0900 HR 0508 0
HR 28 0901 HR 29 1000 HR 0509 0
HR 30 1001 HR 31 1100 HR 0510 0
HR 32 1101 HR 33 1200 HR 0511 0
HR 34 1201 HR 35 1300 HR 0512 0
HR 36 1301 HR 37 1400 HR 0513 0
HR 38 1401 HR 39 1500 HR 0514 0
HR 40 1501 HR 41 1600 HR 0515 0
BCMP(68)
001
HR 10
HR 05
00000
Compare data in IR 001
(which contains 0210)
with the given ranges.
Address Instruction Operands
00000 LD 00000
00001 BCMP(88)
001
HR 10
HR 05
5-15-5 TABLE COMPARE – TCMP(85)
CD: Compare data
IR, SR, AR, DM, HR, TC, LR, #
TB: First comparison table word
IR, SR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
R: Result word
IR, AR, DM, HR, TC, LR
TCMP(85)
CD
TB
R
@TCMP(85)
CD
TB
R
When the execution condition is OFF, TCMP(85) is not executed. When the
execution condition is ON, TCMP(85) compares CD to the content of TB,
TB+1, TB+2, ..., and TB+15. If CD is equal to the content of any of these
words, the corresponding bit in R is set, e.g., if the CD equals the content of
TB, bit 00 is turned ON, if it equals that of TB+1, bit 01 is turned ON, etc. The
rest of the bits in R will be turned OFF.
Flags ER: The comparison table (i.e., TB through TB+15) exceeds the data
area.
Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
Example
Description
Data Comparison Section 5-15