741
Subroutines
Section 3-19
and the Error Flag will be turned ON when the GSBS(750) instruction is exe-
cuted.
The GSBS(750) instruction can be written both cyclic tasks (including extra
cyclic tasks) and interrupt tasks.
Precautions
• When the subroutine isn’t being executed, the instructions are treated as
NOP(000).
• Place the global subroutine region (GSBN(751) to GRET(752)) in inter-
rupt task 0 just before the END(001) instruction. When two or more global
subroutines are being used, group them together in interrupt task 0 after
the end of the main program. If part of the main program is placed after
the global subroutine region, that program section will be ignored.
• The input method for the global subroutine number, N, is different for the
CX-Programmer and a Programming Console. Input #0 to #1023 on the
CX-Programmer and 0000 to 1023 on a Programming Console.
GSBS
n
GSBN
n
GRET
END
Cyclic or interrupt task
Interrupt task 0
Global
subroutine
region
GSBN
n
GRET
END
Global
subroutine
region
This part of the
program won’t
be executed.
Interrupt task 1
Summary of Contents for CJ1G-CPUxx
Page 3: ...iv N o t i c e ...
Page 5: ...vi ...
Page 21: ...xxii Conformance to EC Directives 6 ...
Page 35: ......
Page 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...