DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-178
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
By placing code in a subroutine it is only scanned and executed when needed, since it resides
after the End instruction. Code which is not scanned does not impact the overall scan time of
the program.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
a
b
c
D
K aaa
GTS
K aaa
SBR
RT
RTC
Operand Data Type
DL06 Range
aaa
Constant K
1-FFFF
DS
Used
HPP Used
DS
Used
HPP Used
DS
Used
HPP Used
Goto Subroutine (GTS) (SBR)
The Goto Subroutine instruction allows a section of ladder logic
to be placed outside the main body of the program, to execute
only when needed. There can be a maximum of 256 GTS
instructions and 256 SBR instructions used in a program. The
GTS instructions can be nested up to 8 levels. An error E412 will
occur if the maximum limits are exceeded. Typically this will be
used in an application where a block of program logic may be
slow to execute and is not required to execute every scan. The
subroutine label and all associated logic is placed after the End
statement in the program. When the subroutine is called from
the main program, the CPU will execute the subroutine (SBR)
with the same constant number (K) as the GTS instruction which
called the subroutine.
Subroutine Return (RT)
When a Subroutine Return is executed in the subroutine the CPU
will return to the point in the main body of the program from
which it was called. The Subroutine Return is used as termination
of the subroutine. It must be the last instruction in the subroutine
and is a stand alone instruction (no input contact on the rung).
Subroutine Return Conditional (RTC)
The Subroutine Return Conditional instruction is an optional
instruction used with an input contact to implement a conditional
return from the subroutine. The Subroutine Return (RT) is still
required for termination of the Subroutine.