Oc_readsram -61 – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual
Page 115

OC_ReadSRAM
Library of Routines
6–61
Publication 1747-6.5.3 June 1998
OC_ReadSRAM
OC_ReadSRAM reads data from the battery-backed user memory.
Syntax:
int OC_ReadSRAM(HANDLE Handle, BYTE *bufptr, DWORD offset, DWORD length);
Description:
The battery-backed memory may be used to store important data that needs to be preserved in the event of
a power failure. The size of the available memory in bytes may be obtained using OC_GetDeviceInfo.
Important:
It is recommended that the integrity of data stored in the user memory
be verified by some means. The OC_CalculateCRC function may be
used to generate a 16-bit CRC that may be used for this purpose.
handle
must be a valid handle returned from OC_OpenScanner.
bufptr
points to a buffer to be receive
the data.
offset
specifies the offset within the memroy to begin reading.
length
specifiies the number
of bytes to be read.
If
offset
+
length
points past the end of the memory, no bytes will be written and ERR_OCPRAM
will be returned.
Return Value:
Considerations:
Supported in the Windows NT API library only.
Name:
Description:
SUCCESS
data was read successfully
ERR_OCACCESS
handle
does not have access to scanner
ERR_OCPARAM
offset+length
points past the end of the memory