RTC
®
5 PC Interface Board
Rev. 1.9 e
6 Developing User Applications
77
innovators for industry
Indexed subroutines are written to “List 3” via the
command in order of entry. The smallest
possible starting address is thereby automatically
determined, in accordance with already registered
indexed subroutines (and character sets). If an
indexed subroutine is stored using an already-
existing index, then the prior subroutine with that
same index will not be overwritten, and remains in
the protected buffer area (“List 3”), though it can
then no longer be accessed through its index via
(but can still be called through its absolute
memory address).
to query whether a subroutine
is referenced via a particular index. If no subroutine is
referenced, the return value will be “–1” (i.e. 2
32
–1).
To load an indexed subroutine into a protected buffer
area that is already fully loaded with indexed subrou-
tines, you must first appropriately expand the
protected buffer area’s size with
and then
defragment it with
/
(expanding
the size alone is not sufficient; see
).
Observe the following guidelines when programming
indexed subroutines:
• In an indexed subroutine, the
command will be replaced with a
command.
• Absolute jumps within or out from the protected
buffer area (“List 3”) will be ignored during
execution (see
). Therefore,
absolute jumps cannot be used in indexed
subroutines.
• Relative jumps that exceed the boundaries of an
indexed subroutine and a jump command which
initiates a jump on the command itself will be
ignored during execution, too.
Calling Subroutines
Subroutines are not started directly, but instead via a
list command within a list or from a subroutine.
Nested calls up to a maximum depth of 63 are also
possible.
“Normal” Calls
As previously described, non-indexed subroutines
can be called via the
command and a
parameter specifying the absolute memory address.
Indexed subroutines can be called either via the
command along with the index or via the
command along with the absolute memory
address.
Notes
• Index management or defragmentation (see
) can result in a change of the indexed
subroutine’s absolute memory address.
Therefore, SCANLAB recommends not calling
indexed subroutines via the
command.
“AbsCalls”
With the RTC
®
5’s predecessor boards, subroutines
could only use
relative
vector and arc commands (see
) if the corresponding processes were
intended to be repeated in different parts of the
image field.
Thanks to “AbsCalls”, the RTC
®
5 has removed this
restriction. “AbsCalls” pass on the current position in
the form of an offset that is usable for subsequent
execution of absolute vector and arc commands in
the subroutine. Nested calls are taken into account
when the offset is determined. This can be used, for
instance, to define character sets via absolute vectors.
“AbsCalls” from subroutines can be made with the
commands
Conditional Calls
To enable calling of subroutines (“normal” calls and
“AbsCalls”) dependent on external control signals,
additional commands are available for conditional
branching during program execution (see
tional Command Execution", page 213
).