6.5 Structured Programming
The RTC6 command set supports structured
programming and output of list commands by
numerous ways to define subroutines and character
sets, as well as list commands for controlling
program flow.
6.5.1 Subroutines
• As list-command sequences, subroutines can
principally be located in any part of the
Memory.
• Preferably, subroutines should be written to a
upper portion of the
RTC6 List Memory
Section ""List 3"– Protected RTC6 List Memory
Area", page
102.
• A list boundary should not run through a
subroutine.
• A subroutine must be terminated with a
list_return.
• It can be defined:
–
Non-Indexed Subroutines
–
Indexed Subroutines
Non-Indexed Subroutines
As with "normal" list-command sequences, non-
indexed subroutines are loaded into a
Memory
area ("List 1" or "List 2") by list-loading
commands (see
Chapter 6.4.1 "Loading Lists",
page
105). Each subroutine must be terminated with
a list_return. It is called by
specifying the absolute memory address.
After the subroutine (including the terminating
list_return
command) has been processed, it is
continued with the command that follows the calling
position.
RTC6 boards
Doc. Rev. 1.0.21 en-US
6 Developing RTC6-User Programs
RTC6 List
area, see
RTC6 List
list_call
with a parameter
Notes
• Non-indexed subroutines cannot be written
directly to the protected
"List 3". However, they can be subsequently
protected, see also
Section "Subsequent
Protection and Conversion of Non-Indexed
Subroutines", page
116. For the subroutine to be
indexed for this purpose with set_sub_pointer,
however, its start address must be known. Prior to
loading a non-indexed subroutine into the
RTC6 List Memory
area "List 1" or "List 2", you
should therefore always read out the start
address by get_input_pointer.
• Make sure that there is no
list flow or in a body of a subroutine, for which
there has not been a corresponding subroutine
call. Otherwise, with nested subroutine calls the
integrity of the nesting is destroyed. If there is no
still active subroutine call, list processing is
continued at the absolute position 0.
If a subroutine begins directly after a list_call,
list_call_abs, list_call_repeat, or
list_call_abs_repeat, then the return address is
automatically set from Pos(list_call) + 1 to
Pos(list_return) + 1 . That is, the next processed
command is the one which follows after
list_return
but not the command which follows
list_call
after
(which would process the
subroutine once again having an uncorrelated
list_return).
RTC6 List Memory
area
list_return
in a normal
112
Need help?
Do you have a question about the RTC6 PCIe Board and is the answer not in the manual?