Omron CJ - INSTRUCTIONS Reference Manual page 1095

Table of Contents

Advertisement

Tasks and Block Programs
Block programs can be located within tasks. While tasks are used to divide large programming units,
block programs can be used within tasks to further divide programming into smaller units controlled with
a single ladder diagram execution condition.
Just like tasks, block programs that are that are not executed (i.e., which have an OFF execution
condition) do not require execution time and can thus be used to reduce the cycle time (somewhat the
same as jumps). Also like tasks, other blocks can be paused or restarted from within a block program.
There are, however, differences between tasks and block programs. One difference is that input
conditions are not used with block programs unless intentionally programmed with IF(802), WAIT(805),
EXIT(806), IEND(810) or other instructions. Also, there are some instructions that cannot be used
within block programs, such as those that detect upward and downward differentiation.
Block programs can be used either within cyclic tasks or interrupt tasks. Each block program number
from 0 to 127 can be used only once and cannot be use again, even in a different task.
Task 1
Task 2
Task n
Using Block Programming Instructions
• Basically speaking, IF(802), ELSE(803), and IEND(810) are used for execution conditions (along with
bits) inside block programs.
If "A" or "B" is to be executed then IF A ELSE B IEND are used as shown below.
Execution
condition
If "A" or nothing is to be executed, IF A IEND are used as shown below.
Execution
condition
• If execution is to wait until an execution condition or bit is ON (e.g., for step progressions), then
WAIT(805) is used.
• If execution is to wait until for a specified period of time (e.g., for timed step progressions), then
TIMW(813), TIMX(816), TMHW(815), or TMHWX(817) is used.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Program
Block program 001
Block program n
Execution
condition ON?
"B" executed
"A" executed (be-
tween IF and ELSE).
(after ELSE).
Execution
condition ON?
"A" executed (be-
tween IF and IEND).
3. Instructions
3
1057

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents