6 - library of routines, Introduction, Oc_calculatecrc – Rockwell Automation 1747-PCIS API Software - Open Controller User Manual
Page 61: Chapter 6, Library of routines, Introduction -1 oc_calculatecrc -1, Chapter

1
Publication 1747-UM002A-US-P - June 2000
Chapter
6
Library of Routines
Introduction
The MS-DOS API is a run-time library that can be linked with most
industry standard programming language compilers using the Pascal
calling convention.
The Windows NT API is a 32-bit DLL that can be linked with most
industry-standard programming language compilers.
This chapter provides the programming information for each routine
and identifies which operating system supports the routine. The
calling convention for each API function is shown in C format.
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
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