Omron CS1G/H-CPUxxH Instructions Manual page 744

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

Advertisement

Subroutines
Flags
Precautions
1,2,3...
Examples
Main program
Subroutine 1
Name
Label
Error Flag
ER
SBS(091) and the corresponding SBN(092) must be programmed in the same
task. An error will occur if the corresponding SBN(092) isn't in the task.
SBS(091) will be treated as NOP(000) when it is within a program section
interlocked by IL(002) and ILC(003).
When SBS(091) is executed in the following cases, the subroutine won't actu-
ally be called and the Error Flag will be turned ON:
1. The specified subroutine is not defined within the current task.
2. The subroutine is calling itself.
3. Subroutine nesting exceeds 16 levels.
4. The specified subroutine is being executed.
Example 1: Sequential (Non-nested) Subroutines
When CIO 000000 is ON in the following example, subroutine 1 is executed
and program execution returns to the next instruction after SBS(091). The
remainder of the main program (through the instruction just before SBN(092)
1) is then executed.
Subroutine program:
S
Example 2: Sequential (Non-nested) Subroutines
When CIO 000000 is ON in the following example, subroutine 1 is executed
and program execution returns to the next instruction after SBS(091) 1. When
CIO 000001 is ON, subroutine 2 is executed and program execution returns
to the next instruction after SBS(091) 2.
Operation
ON if nesting exceeds 16 levels.
ON if the specified subroutine number doesn't exist.
ON if a subroutine calls itself.
ON if a subroutine being executed is called.
ON if the specified subroutine isn't defined in the current
task.
OFF in all other cases.
1
CIO 000000 ON
3
2
Section 3-19
Order of execution
A→S→B
A→B
723

Advertisement

Table of Contents
loading

Table of Contents