![Omron CJ1G-CPU series Programming Manual Download Page 188](http://html1.mh-extra.com/html/omron/cj1g-cpu-series/cj1g-cpu-series_programming-manual_742489188.webp)
167
Using Tasks
Section 4-2
8.
Assign I/O memory into memory shared by tasks and memory used only
for individual tasks, and then group I/O memory used only for individual
tasks by task.
Relationship of Tasks to
Block Programs
Up to 128 block programs can be created in the tasks. This is the total number
for all tasks. The execution of each entire block program is controlled from the
ladder diagram, but the instructions within the block program are written using
mnemonics. In other words, a block program is formed from a combination of
a ladder instruction and mnemonic code.
Using a block program makes it easier to write logic flow, such as conditional
branching and process stepping, which can be hard to write using ladder dia-
grams. Block programs are located at the bottom of the program hierarchy,
and the larger program units represented by the task can be split into small
program units as block programs that operate with the same execution condi-
tion (ON condition).
4-2-5
Global Subroutines
Global subroutine can be called from more than one task. They are supported
only by CS1-H, CJ1-H, or CJ1M CPU Units.
With the CS1 or CJ1 CPU Units, a subroutine in one task cannot be called
from other tasks. With the CS1-H, CJ1-H, or CJ1M CPU Units, however, glo-
bal subroutines can be created in interrupt task number 0, and these subrou-
tines can be called from cyclic tasks (including extra cyclic tasks).
The GSBS instruction is used to call a global subroutine. The subroutine num-
ber must be between 0 and 1,023. The global subroutine is defined at the end
of interrupt task number 0 (just before END(001)) between the GSBN and
GRET instructions.
Global subroutines can be used to create a library of standard program sec-
tions that can be called whenever necessary.
Task 0
Task 1
Task n
Program
Block program 000
Block program 001
Block program n
Block program area 000
Block program area 001
Summary of Contents for CJ1G-CPU series
Page 3: ...iv...
Page 5: ...vi...
Page 21: ...xxii Conformance to EC Directives 6...
Page 169: ...148 Task Control Instructions Section 3 32...
Page 203: ...182 Programming Device Operations for Tasks Section 4 4...
Page 253: ...232 Using File Memory Section 5 3...
Page 337: ...316 Other Functions Section 6 11...
Page 347: ......
Page 369: ......
Page 373: ......
Page 379: ......
Page 381: ...360 Revision History...