Rockwell-automation 1747-PCIS API Software - Open Controller Manual de usuario Pagina 113

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 174
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
Vista de pagina 112
1 2 ... 108 109 110 111 112 113 114 115 116 117 118 ... 173 174

Comentarios a estos manuales

Sin comentarios