Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 715

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Subroutines
682
This instruction can be written into multiple tasks with the same global subrou-
tine number to call that program from the different tasks. The program can be
modularized by making global subroutines into standard subroutines that are
common to many tasks.
The global subroutine region (between GSBN(751) and GRET(752)) must be
defined in interrupt task 0. If it is defined in another task, an error will occur
and the Error Flag will be turned ON when the GSBS(750) instruction is exe-
cuted.
The GSBS(750) instruction can be written in both cyclic tasks (including extra
cyclic tasks) and interrupt tasks.
Cyclic or interrupt task
Cyclic or interrupt task
0.00
GSBS
n
B
Interrupt task 0
GSBN
n
A
GRET
END
Execution
condition ON
0.01
GSBS
n
Main
program
C
Global subroutine
program
(GSBN(751) to
GRET(752))
Section 3-18
Execution
condition ON
B
C
A
A

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents