Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual

Page 116

Advertising
background image

6–62

Library of Routines

OC_ReadSRAM

Publication 1747-6.5.3 June 1998

Example:

Byte

buf[100];

/*buffer of 100 bytes of important data*/

HANDLE handle;

Word crc, crc_saved;

/* Read 100 bytes of data from offset 0 in SRAM */

OC_ReadSRAM(handle, buf, 0, 100);

/* Calculate CRC */

OC_CalculateCRC(buf, 100, &crc);

/* Read saved CRC at offset 100 in SRAM */

OC_ReadSRAM(handle, &crc_saved, 100, 2);

/* Check CRC */

if (crc != saved_crc)

printf(“ERROR: Data is corrupted.\n”);

Advertising
This manual is related to the following products: