Omron CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 Reference Manual page 307

Programmable controllers
Hide thumbs Also See for CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009:
Table of Contents

Advertisement

3. Instructions
Operand Specifications
Word addresses
Area
CIO
WR
HR
S
B
OK
OK
OK
R
Flags
Name
Error Flag
Function
BCMP2(502) compares the source data (S) to the ranges defined by pairs of lower and upper limit
values in the comparison block. If S is within any of these ranges (inclusive of the upper and lower
limits), the corresponding bits in the result words (R to R+15 max.) are turned ON. The rest of the bits in
R will be turned OFF.
The number of ranges is determined by the value N set in the lower byte of B. N can be between 0 and
255. The upper byte of B must be 00 hex.
Number of Ranges
The number of ranges in the comparison block is set in the first word of the block. Up to 256 ranges can
be set.
Setting Ranges
The values A and B for each range will determine how the comparison operates depending on which
value is larger, as shown below.
· If Value A ≤ Value B
Then, Value A ≤ Comparison range ≤ Value B
Comparison range
Value A
270
AR
T
C
DM
EM
OK
OK
OK
OK
OK
Label
ER
OFF
Comparison block
15
8
B
00 hex
Comparison ranges
B+1
Range 0 value A
B+3
Range 1 value A
Source data
B+5
Range 2 value A
S
B+31
Range 15 value A
B+33
Range 16 value A
B+35
Range 17 value A
B+37
Range 18 value A
B+2N+1
Range N value A
Value B
Indirect
DM/EM
Con-
addresses
stants
@DM
*DM
DR
@EM
*EM
OK
OK
OK
OK
---
---
Operation
7
0
Last range
N: 00 to FF hex (0 to 255)
"N"
Result words
R
Range 0 value B
B+2
0
Range 1 value B
B+4
1
Range 2 value B
B+6
2
:
:
B+32
Range 15 value B
15
R+1
B+34
0
Range 16 value B
1
B+36
Range 17 value B
2
B+38
Range 18 value B
:
:
B+2N+2
Range N value B
In range: ON
Ranges
Not in range: OFF
· If Value A ≤ Value B
Then, Comparison range ≤ Value B and Value A ≤ Comparison range
Comparison
range
Value B
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Registers
Pulse
TK
CF
bits
Indirect
IR
using IR
---
OK
---
---
---
Bit
Bit
Comparison
range
Value A
TR
bits
---

Advertisement

Table of Contents
loading

Table of Contents