• In contrast, the output of a differentiated instruction (DIFU(013) or DIFD(014)) would remain ON if the
instruction was executed and the output was turned ON but the same global subroutine was not
called a second time.
In the following example, global subroutine 1 is executed if CIO 0.00 is ON. Output CIO 1.00 is
turned ON by DIFU(013) when CIO 0.01 has gone from OFF to ON. If CIO 0.00 is OFF in the
following cycle, subroutine 1 will not be executed again and output CIO 1.00 will remain ON.
Sample program
Cyclic or interrupt task
A
0.00
CIO 0.00 ON
GSBS
n
B
END
Interrupt task 0
GSBN
1
Global
subroutine
program S
GRET
END
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Cyclic task 1
0.00
GSBS
1
Interrupt task 0
GSBN
1
0.01
DIFU
100
GRET
Cyclic or interrupt task
C
0.01
CIO 0.01 ON
GSBS
n
D
END
The subroutine is
not executed in
following cycles.
When CIO 0.00 is ON in the following example,
global subroutine 1 is executed and program
execution returns to the next instruction after
GSBS(750).
Status of CIO
Order of program
0.00
ON
A
OFF
When CIO 0.01 is ON in the following example,
global subroutine 1 is executed and program
execution returns to the next instruction after
GSBS(750).
Status of CIO
Order of program
0.01
ON
C
OFF
3. Instructions
execution
S
B
A
B
execution
S
D
C
D
695
3
Need help?
Do you have a question about the CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 and is the answer not in the manual?
Questions and answers