Hardware Manual for the PCD3 Series│Document 26/789; Version E 5│31.01.2005
Saia-Burgess
Controls Ltd.
Backup of the user program
PCD3.Mxxx0 Classic CPUs and expansion housings
3-24
3
3.13.5 Backup/restore of RAM texts/DBs at run-time
As described above, the application can be copied to the flash card after
downloading. In order to store process data gathered during operation, there is a
facility to copy texts or DBs from extension memory (address ≥ 4000) to the flash
card, or conversely, to copy the last state written to the flash card back in the text/DB
in extension memory. A maximum of 64 kBytes are available for this.
For storing texts/DBs on the flash card, restoring, deleting and running diagnostics,
there are four SYSRD/SYSWR instructions provided, as described in detail below;
these can be invoked
at a suitable place
in the user program. These instructions
must be used with great care, to prevent any damage to the unit or the flash card.
Storing a text/DB on the flash card with SYSWR K 3000
Storing a text/DB on the onboard flash with SYSWR K 3100
Instruction:
SYSWR
K 3x00
1)
K number
; Address of text/DB as
; K constant or in a register
; existing texts/DBs in
; the range xxx may be used ≥ 4000
1) Alternatively, the value 3x00 can be passed in a register.
Battery status after execution:
low:
the text/DB has been saved, and the flash card is ready
for new SYSWR instructions
high:
the last instruction was not processed to completion;
before further SYSWR K 3x0x instructions, a SYSRD
K 3x0x must be executed to check the readiness of the
flash card
When using the instruction SYSWR K 3x00, note the following:
The flash card can be written to a maximum of 100‘000 times, so it is not
permissible to invoke the instruction in a cyclical manner or at short intervals.
It is strongly recommended to execute a SYSRD K 3x00 before this instruction, to
test whether the flash card is available and ready.
The processing time for the instruction may be up to 100 ms. At that point, there is
no guarantee that all of the text/DB has been written (the process will continue in
background). For this reason,, the instruction must not be invoked in XOB 0 (XOB
for a power failure) or during time-critical processes.
If errors occur during processing, XOB 13 will be invoked (where present), or the
Error LED will be set.
i
When starting the PCD after a loss of RAM memory, the state of the texts/DBs
after the last download
is restored, even where the SYSWR K 3x00 instruction
has been used to store newer versions.
Within the maximum number of write cycles, a text/DB can be stored any number
of times, without the flash card becoming over-full.