Omron CJ - INSTRUCTIONS Reference Manual page 1114

Table of Contents

Advertisement

3. Instructions
Function
The first part of the block program is executed the first time the block program is entered. When
CNTW(814)/CNTWX(818) is reached, the Completion Flag is reset to 0, the counter is preset to SV,
and execution of the rest of the block program will wait until the counter has counted out. The counter
counts pulses (upward differentiation) on I, the counter input.
While the counter is counting down, only CNTW(814)/CNTWX(818) will be executed to update the
counter. When the counter counts out, the Completion Flag will turn ON and the rest of the block
program will be executed.
Hint
• CNTW(814)/CNTWX(818) can be thought of as a WAIT instruction with a counter for the execution
condition and it can thus be used for timed step progressions.
Precautions
• The rest of the block program following CNTW(814)/CNTWX(818) will be executed if the Completion
Flag for the counter is force set.
• If the Completion Flag for the counter is force reset, the only CNTW(814)/CNTWX(818) will be
executed in the block program until the force reset status is cleared.
• The counter numbers are also used by the other counter instructions. Operation will not be
predictable if the same counter number is used for more than one counter instruction. Use each
counter number only once. The only way that the same counter number can be used dependably is if
only one of the counters is ever operating at the same time. An error will occur in the program check
if the same counter number is used in more than one counter instruction.
Example Programming
0.00
0
CIO 1.00 counted.
5
1.00
• When CIO 0.00 is ON in the following example,
"A" will be executed and then execution of the
rest of the block program "B" will wait until 7,000
counts of CIO 1.00.
Program execution will flow from 2 to 3 to 4 and
back to 2 during the 7,000 counts before "B" is
executed, as shown in the following diagram.
1076
"A"
executed.
SV preset.
Count reached.
"C"
"C"
executed.
executed.
Coding
Updated
Updated
Counter counts out.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
"B" executed.
"C"
executed.
Address
Instruction
000200
LD
000201
BPRG
.
A
.
000210
CNTW
.
B
.
000220
BEND
1
4
2
Operand
0.00
0
.
.
5
#7000
1.00
.
.
---
3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents