101
Address Instruction Operands Address Instruction Operands
000 LD 0000
001 IL(02)
002 TIM 10
# 5000
003 CMP(32)
TIM 10
# 4000
004 AND 0313
005 OUT 0100
006 CMP(32)
TIM 10
# 3000
007 AND 0313
008 OUT 0101
009 ILC(03)
010 LD TIM 10
011 OUT 0103
3-7-26 BLOCK COMPARE - BCMP(34)
SP16 and SP20 Only
CD: Compare data
I/O, work, dedicated (03 only), DR, LR, TC, #
CB: First comparison block word
DR (00 to 13 only)
Ladder Symbol
Operand Data Areas
R: Result word
I/O (01 only), work, DR, LR
BCMP(34)
CD
CB
R
All data must be in BCD. Press the CONT/# Key before entering a constant
for CD.
N is the rightmost digit of CB and determines the size of the comparison
block; there will be N+1 comparison ranges. BCMP(34) compares CD to the
ranges defined by a block consisting of CB+1, CB+2, ..., CB+(2N+2). Each
range is defined by two words, the first one providing the lower limit and the
second word providing the upper limit, as shown below. If the lower limit is
less than the upper limit, the corresponding bit of the result word, R, will be
turned ON whenever CD is within the preset range.
Table Comparisons Bit in R
CB+1 ≤ CD ≤ CB+2 Bit 00
CB+3 ≤ CD ≤ CB+4 Bit 01
.. .
.. .
.. .
CB+ (2N+1)≤ CD ≤ CB+(2N+2) Bit N
If the lower limit is greater than the upper limit, the corresponding bit of the
result word will be turned ON whenever CD is not within the preset range.
Table Comparisons Bit in R
CD ≤ CB+1 or CB+2 ≤ CD Bit 00
CD ≤ CB+3 or CB+4 ≤ CD Bit 01
.. .
.. .
.. .
CB+(2N+1) ≤ CD or CB+(2N+2) ≤ CB Bit N
Limitations
Description
Instruction Set Section 3-7