Battery-backed ram disable – call 73, Battery-backed ram enable – call 74, Protected variable storage – call 77 – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 127

Advertising
background image

Operating Functions

Chapter 5

5–90

CALL 73 disables the battery-backed RAM, prints “Battery Backup
Disabled” when executed and allows a purging reset. The next power loss
destroys the contents of RAM. When power is reapplied, RAM is cleared
and battery back-up is reenabled automatically.

CALL 74 enables the battery-backed RAM and prints “Battery Backup
Enabled” when executed. It is enabled on power-up and remains enabled
until you execute a CALL 73 or until the battery fails.

Important: Change MTOP from command mode only to ensure proper
operation

CALL 77 reserves the top of RAM memory for protected variable storage.
Values are saved if BATTERY-BACKUP is invoked. You store values with
the ST @ command and retrieve them with the LD @ command. Each
variable stored requires 6 bytes of storage space.

You must subtract 6 times the number of variables to be stored from
MTOP reducing available RAM memory. This value is PUSHed onto the
stack as the new MTOP address. All appropriate variable pointers are
reconfigured. Do this only in command mode.

Important: Do not let the ST @ address write over the MTOP address.
This could alter the value of a variable or string.

Example: For saving 2 variables.

uPRINT MTOP
14335
uPRINT MTOP-12
14323
uPUSH 14323:REM NEW MTOP ADDRESS

uCALL 77

u10 K = 678 * PI

u15 L =520 PUSH K

u30 ST @ 14335:REM STORE K IN PROTECTED AREA

u40 PUSH L

u50 ST @ 14329

u55 REM TO RETRIEVE PROTECTED VARIABLES

u60 LD@ 14335:REM REMOVE K FROM PROTECTED AREA

u70 POP K

u80 LD@ 14329

u90 POP L

u100 REM USE LD@ AFTER POWER LOSS AND BATTERY BACK-UP IS USED

5.11.4
Battery-backed RAM
Disable – CALL 73

5.11.5
Battery-backed RAM
Enable – CALL 74

5.11.6
Protected Variable
Storage – CALL 77

Advertising