RTC
®
5 PC Interface Board
Rev. 1.9 e
10 Commands And Functions
398
innovators for industry
Ctrl Command save_disk
Function
stores all indexed characters, text strings and/or subroutines to a binary file on a PC storage
medium, ordered by index, and returns the number of thereby stored list commands.
Call
NoOfSavedCommands = save_disk( Name, Mode )
Parameters
Name
File name as a pointer to a null-terminated ANSI string
Mode
This parameter (unsigned 32-bit value) specifies what should be stored:
Bit #0 = 1: All indexed characters and text strings will be stored.
Bit #1 = 1: All indexed subroutines will be stored.
Bits #2-31: are not evaluated
Result
The number of list commands saved via
save_disk
, as an unsigned 32-bit value
Comments
• The
save_disk
command can be used together with
, for example, to perform
defragmentation or to apply subsequent protection to subroutines (see
• The
save_disk
command stores complete sets (no individual characters, text strings or
subroutines!) in the specified file. Indexed characters, text strings or subroutines that
are referenced multiple times with
will be correspondingly duplicated via
save_disk
, i.e. also stored multiple times. The
save_disk
command ignores unrefer-
enced non-indexed (not subsequently referenced via
text strings and subroutines.
•
save_disk
stores to the binary file not only the list commands for characters, text strings
and/or subroutines, but also their indexes and the number of commands.
• The number of list commands stored with
save_disk
can differ considerably from the
number of the list commands stored in the protected-area “List 3“ (= 2
20
–
Mem1
–
Mem2
), due to possible multiple referencing of an indexed character, text
string or subroutine or referencing of an indexed character, text string or subroutine in
the unprotected memory area (“List 1” or “List 2”). Prior to a subsequent
, the
returned number must be compared to the size of the protected memory area (= 2
20
–
Mem1
–
Mem2
).
• No-longer-needed characters (or text strings or subroutines) should be dereferenced via
(or
previously
to
save_disk
(see
).
•
save_disk
always stores all characters, text strings and/or subroutines from the refer-
enced address to the next possible
. Jump commands (also branches to
various
commands) are thereby neither evaluated nor executed.
• The
save_disk
command automatically replaces unallowed commands (e.g.
commands; missing commands (e.g.
reaching the last memory position of “List 3”) will be added.
• If
Mode
= 0 or
Name
= 0, then
save_disk
will be ignored (
:
RTC5_PARAM_ERROR
). The command will also be ignored (
return code
:
RTC5_BUSY
) if the board’s BUSY status is currently set (list is being processed or has been
) or the board’s INTERNAL-BUSY status is currently set. In contrast,
if a list has only been paused via
PAUSED status set), then
save_disk
can be
executed.
• While the
save_disk
command is running, no further commands can be executed.
During execution of this command, external starts will be suppressed.
RTC
®
4
RTC
®
5 new command
References