EasyManua.ls Logo

Scanlab RTC6 PCIe Board - 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
113
innovators for industry
Indexed Subroutines
load_sub assigns a desired index to a subroutine
(which is defined by subsequent list commands), and
loads it into the protected RTC6 List Memory area
“List 3”.
An indexed subroutine must be terminated by a
list_return (otherwise it is not stored). It is called by
list_call (with a parameter specifying the index).
A maximum of 1024 subroutines can be stored.
The management of the indexed subroutines occurs
on the RTC6 PCIe Board automatically.
For more information on index management, see
Section ”Index Management and Defragmentation”,
page 115.
The memory address of an indexed subroutine can be
queried by get_sub_pointer. With it, the indexed
subroutine can be called by specifying the absolute
memory address (just as with non-indexed
subroutines).
An indexed subroutine is only stored by load_sub
under the following circumstances:
If prior to loading, configuration of “List 1” and
“List 2” resulted in a protected RTC6 List Memory
area “List 3” of sufficient size. For example, if all
memory is assigned to one or both lists, then no
indexed subroutines can be stored.
get_list_space, if called after a load_sub (but
before the terminating list_return), can be used
for querying the amount of still-available memory
in the protected RTC6 List MemoryRTC6 List
Memory area “List 3”
If the indexed subroutine is terminated by a
list_return
If list_return is preceded by no other command
for positioning the input pointer (for example,
another load_sub, set_input_pointer, or
set_start_list_pos)
If the index is within the valid range (0…1023)
After a list_return, the input pointer becomes
invalid. Any subsequent list commands are no longer
stored.
Indexed subroutines are written to “List 3” by
load_sub commands in order of entry. The starting
address is automatically set after the end of the last
subprogram.
If an indexed subroutine is stored using an already-
existing index, then the prior subroutine with that
same index is not overwritten. It remains in the
protected RTC6 List Memory area “List 3”, though it
is no longer indexed. Therefore, it can no longer be
called through its index by sub_call (whereas it can
be still called through its absolute memory address by
list_call).
Use get_sub_pointer to query whether a subroutine
is referenced by a particular index. If no subroutine is
referenced, get_sub_pointer returns the value “–1”
(that is, 2
32
–1).
To load an indexed subroutine into the protected
RTC6 List Memory area “List 3” that is already fully
loaded with indexed subroutines, you must first
appropriately expand the size of the protected
RTC6 List Memory area “List 3” by config_list and
then defragmenting it by save_disk
/load_disk. N
ote
that expanding the size alone is not sufficient, see
Section ”Index Management and Defragmentation”,
page 115.
Notes on Not-Indexed Calls
Index management or defragmentation, see
Section ”Index Management and
Defragmentation”, page 115, can result in a
change of the indexed subroutine absolute
memory address. SCANLAB therefore advises
against calling an indexed subroutine by list_call.

Table of Contents