Omron CJ - INSTRUCTIONS Reference Manual page 787

Table of Contents

Advertisement

• For range comparisons, the interrupt task for any one range will be executed only once each time the
comparison value enters or leaves the range. It will not be executed again until the condition for
execution is no longer met and then met again. The Range Comparison Condition Met Flag, however,
will be ON whenever the comparison value is within the range regardless of the out of range/in range
specification.
• Set the interrupt task number to FFFF hex to disable the range. Any range set to FFFF hex will be
ignored.
Example Programming
When CIO 0.00 turns ON in the following programming example, CTBL(882) registers a target value
comparison table and starts comparison for high-speed counter 0. The PV of the high-speed counter is
counted incrementally and when it reaches 500, it equals target value 1 and interrupt task 1 is
executed. When the PV is incremented to 1000, it equals target value 2 and interrupt task 2 is executed.
High-speed counter PV
Target value 2: 1,000 decimal
Target value 1: 500 decimal
Interrupt task that is started
Example for Range Comparison with Eight Ranges
When CIO 0.00 turns ON in the following
programming example, CTBL(882) registers a range comparison table using upper and lower limits for
high-speed counter 0 and starts comparison.
The corresponding interrupt task is called and executed when the PV is within the limits set for range 1 or 2.
High-speed counter PV
Upper limit value 2: 2,100 decimal
Lower limit value 2: 1,900 decimal
Upper limit value 1: 1,050 decimal
Lower limit value 1: 950 decimal
No.000
Interrupt task number to execute
CS/CJ/NSJ Series Instructions Reference Manual (W474)
No.2
No.1
0.00
No.255
No.255
No.000
0.00
@CTBL
High-speed counter input 0
#0000
Register target comparison table
#0000
and start comparison
D100
D100
D101
D102
D103
D104
D105
D106
Operating time
No.1
@CTBL
High-speed counter input 0
Range comparison table registration
#0000
and comparison start for 8 ranges
#0001
First range comparison table word
D200
D200
#03B6
D201
#0000
D202
#041A
D203
#0000
D204
#0000
D205
#076C
D206
#0000
D207
#0834
D208
#0000
D209
#00FF
FFFF hex is set in D214, D219, D224, D229,
D234, and D239. (Ranges 3 to 8 are not used.)
Time
3. Instructions
0002
Number of target values: 2
01F4
Target value 1
01F4 hex (500 decimal)
0000
Target value 1 interrupt task No.:
0001
1 (incrementing)
03E8
Target value 2
0000
03E8 hex (1,000 decimal)
Target value 2 interrupt task No.:
0002
2 (incrementing)
Lower limit value: 1
03B6 hex (950 decimal)
Upper limit value: 1
041A hex (1,050 decimal)
Interrupt task 0
Range 1 interrupt task No.: 0 (entering range)
Lower limit value: 2
076C hex (1,900 decimal)
Upper limit value: 2
0834 hex (2,100 decimal)
Range 2 interrupt task No.: 255 (entering range)
749
3

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CJ - INSTRUCTIONS and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF