Rockwell-automation 1747-PCINT API Software for 1746 I/O Manual de usuario Pagina 56

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 155
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 55
6–2 Library of Routines OC_CalculateCRC
Publication 1747-6.5.3 June 1998
OC_CalculateCRC OC_CalculateCRC calculates a 16-bit CRC.
Syntax:
void OC_CalculateCRC(BYTE *bufPtr, WORD bLen, WORD *Crc);
Parameters:
Description:
This function is useful for verifying data integrity. For example, a CRC might be appended to data stored
in the host retentive data partition. When the data is later retrieved, a new CRC can be calculated and
compared to the old CRC to ensure the data is valid.
Return Value:
none
Considerations:
Supported in the DOS API library and the Windows NT API library
Example:
BYTE buffer[100];
WORD buffer_crc;
int retcode;
retcode = OC_CalculateCRC( buffer, 100, &buffer_crc );
Parameter: Description:
bufPtr
Points to the buffer that contains the bytes for the CRC calculation
bLen
Number of bytes for which to calculate the CRC
Crc
A word that returns the calculated CRC
Vista de pagina 55
1 2 ... 51 52 53 54 55 56 57 58 59 60 61 ... 154 155

Comentarios a estos manuales

Sin comentarios