EasyManua.ls Logo

Scanlab RTC 5 PC Interface Board - Deprotecting Subroutines; Index Management and Defragmentation

Scanlab RTC 5 PC Interface Board
622 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...
RTC
®
5 PC Interface Board
Rev. 1.9 e
6 Developing User Applications
79
innovators for industry
Before executing the load_disk command, be
sure the protected buffer area (“List 3”) is of suffi-
cient size after configuration of “List 1” and
“List 2” (save_disk returns the number of stored
list commands). An indexed subroutine will not
be stored by load_disk if there is not sufficient
memory.
Conversion of a subroutine by method 2 changes
the absolute memory address of the subroutine.
Deprotecting Subroutines
The protection of a subroutine stored in the
protected buffer area is removed if it is assigned via
config_list to one of the list buffers (“List 1” or
“List 2”).
The subroutine can then still be called using the same
parameters (index or absolute memory address), but
no longer has protection against unintentional over-
writing.
Index Management and Defragmentation
Subroutines can be copied, renumbered or converted
via the copy_dst_src command, which creates an
additional reference (index) to an indexed subroutine
(that can also be called with this new index). The
command only alters the corresponding entry in the
internal management table and does not modify the
list buffer’s memory contents.
Unneeded references (unneeded entries in the
internal management table) can be deleted via the
load_sub command directly followed by a
list_return command. Here, too, deletion occurs only
in the internal management table, while the list
commands of the previously referenced subroutine
continue to reside in the list buffer.
The get_sub_pointer command can be used to query
whether a subroutine is referenced for a particular
index. If no subroutine is referenced, the return value
will be “–1” (i.e. 2
32
–1).
A real copy of an indexed subroutine in the protected
buffer area can be created (after the copy_dst_src
command) with save_disk/load_disk. Subroutines
with multiple references are thereby written several
times to the list memory. Keep this in mind in order
to prevent unintended buffer overflow of the
protected buffer area.
Memory for new indexed subroutines can sometimes
be blocked by no-longer-needed subroutines residing
at lower protected-buffer-area positions than those
of still-needed subroutines – this is because the
load_sub command always places a new indexed
subroutine after the referenced indexed subroutine
with the highest position in the memory. For this
reason, simply increasing the protected buffer area’s
size via config_list will fail to produce further usable
memory for storing additional indexed subroutines
(the protected buffer area can only be expanded
downward, not upward).
This situation can be resolved by defragmenting with
save_disk/load_disk. All indexed subroutines and
non-indexed subroutines subsequently referenced via
set_sub_pointer will thereby be rewritten, starting
at the protected buffer area’s lowest memory
position and ordered by index. The now-available
upper memory can be used for storing additional
indexed subroutines.
Notes
Before using load_disk, be sure the protected
buffer area (“List 3”) is of sufficient size after
configuration of “List 1” and “List 2”. Indexed
subroutines without sufficient space there will
not be stored by load_disk. The save_disk
command returns the number of stored list
commands. No-longer-needed subroutines
should have been previously dereferenced via
load_sub directly followed by list_return.
In some circumstances, index management or
defragmentation can alter the absolute memory
address of an indexed subroutine. It is therefore
not advisable to call an indexed subroutine via the
list_call command.
save_disk stores subroutines starting from the
referenced address to the first-encountered
list_return. Relative jumps are not evaluated. So
don’t use branches to several list_return
commands. Instead, reclose eventual branches in
front of only one single list_return command.

Table of Contents

Related product manuals