• Before executing the
load_disk
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
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
32
will be "–1" (i.e. 2
–1).
A real copy of an indexed subroutine in the protected
buffer area can be created (after the
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
®
RTC
5 PC Interface Board
Rev. 1.9 e
6 Developing User Applications
command, be
if there is not sufficient
copy_dst_src
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
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
commands. Instead, reclose eventual branches in
front of only one single
save_disk
list_return
list_return
command.
79
Need help?
Do you have a question about the RTC 5 PC Interface Board and is the answer not in the manual?