Global Subroutines - Omron CS1G/H-CPUxx-EV1 Programming Manual

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxx-EV1:
Table of Contents

Advertisement

Using Tasks
Relationship of Tasks to
Block Programs
Block program 000
Task 0
Block program 001
Block program n
Task 1
Task n
4-2-5

Global Subroutines

176
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.
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).
Program
Global subroutine can be called from more than one task. They are supported
only by CS1-H, CJ1-H, CJ1M, or CS1D 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, CJ1M, or CS1D CPU Units, how-
ever, global subroutines can be created in interrupt task number 0, and these
subroutines 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.
Section 4-2
Block program area 000
Block program area 001

Advertisement

Table of Contents
loading

Table of Contents