EasyManua.ls Logo

Scanlab RTC6 PCIe Board - Structured Programming; Subroutines; Non-Indexed Subroutines

Scanlab RTC6 PCIe Board
1004 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RTC6 boards
Doc. Rev. 1.0.21 en-US
6 Developing RTC6-User Programs
112
innovators for industry
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 RTC6 List
Memory.
Preferably, subroutines should be written to a
upper portion of the RTC6 List Memory area, see
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 RTC6 List
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 list_call with a parameter
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.
Notes
Non-indexed subroutines cannot be written
directly to the protected RTC6 List Memory area
“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_return in a normal
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
after list_call (which would process the
subroutine once again having an uncorrelated
list_return).

Table of Contents