Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 270

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Comparison Instructions
Flags
Precautions
Example
0.00
D100
D200
D300
S: D100
B+12
S
B+14
S
B+16
S
B+18
S
B+20
S
B+22
S
B+24
S
B+26
S
B+28
S
B+30
S
For example, bit 00 of R is turned ON if S is within the first range (B
B+1), bit 01 of R is turned ON if S is within the second range (B+2
..., and bit 15 of R is turned ON if S is within the fifteenth range (B+30
B+31). All other bits in R are turned OFF.
Name
Label
Error Flag
ER
Equals Flag
=
An error will not occur if the lower limit is greater than the upper limit, but 0
(not within the range) will be output to the corresponding bit of R.
When CIO 0.00 is ON in the following example, BCMP(068) compares the
content of D100 with the 16 ranges defined in D200 to D231 (i.e., D200 and
D201, D202 and D203, etc.) and turns ON the corresponding bits in D300
when S is within the range or OFF when S is not within the range.
D200
D202
D204
D206
D208
D210
D212
D214
D216
D218
D220
D222
D224
D226
D228
D230
B+13
Bit 06 of R
B+15
Bit 07 of R
B+17
Bit 08 of R
B+19
Bit 09 of R
B+21
Bit 10 of R
B+23
Bit 11 of R
B+25
Bit 12 of R
B+27
Bit 13 of R
B+29
Bit 14 of R
B+31
Bit 15 of R
Operation
OFF
ON if the result word is 0000.
(S is not within any of the 16 ranges.)
OFF in all other cases.
to
D201
to
D203
to
D205
to
D207
to
D209
to
D211
to
D213
to
D215
to
D217
to
D219
to
D221
to
D223
to
D225
to
D227
to
D229
to
D231
Section 3-6
S
S
B+3),
S
R: D300
237

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents