Rockwell-automation 1747-PCIS API Software - Open Controller Uživatelský manuál Strana 113

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 174
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 112
Publication 1747-UM002A-US-P - June 2000
Library of Routines 6-53
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.
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”);
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
Zobrazit stránku 112
1 2 ... 108 109 110 111 112 113 114 115 116 117 118 ... 173 174

Komentáře k této Příručce

Žádné komentáře