Applies To
General utility function, not board related.
Purpose
Compares two arrays with a mask value, returns the first value for both arrays that differ.
Syntax
DioCompareData (pvBuffer1, pvBuffer2, pdwStep1, pdwStep2, pvData1, pvData2, dwSize, dwMask, nDataWidth, pnStatus)
Parameters
Name |
Type |
Comments |
pvBuffer1 |
PVOID |
First buffer |
pvBuffer2 |
PVOID |
Second buffer |
pdwStep1 |
PDWORD |
Sets the starting step for first buffer. Returns the failed step number on comparison fail, or –1 on success. |
pdwStep2 |
PDWORD |
Starting step for second buffer. Returns the failed step number on comparison fail, or –1 on success. |
pvData1 |
PVOID |
Returns the failed step data from pvBuffer1 on comparison fail, or –1 on success. |
pvData2 |
PVOID |
Returns the failed step data from pvBuffer2 on comparison fail, or –1 on success. |
dwSize |
DWORD |
Number of steps to compare. |
dwMask |
DWORD |
Mask value when comparing values. |
nDataWidth |
SHORT |
Array data type: 0 COMPARE_DATA_BYTE: data type BYTE. 1 COMPARE_DATA_WORD: data type WORD. 2 COMPARE_DATA_WORD: data type DWORD. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Comments
This function is for general use in order to compare two arrays using a mask value.
Example
The following example compares the first 1000 cells while using a mask:
DWORD dwStep1=0, dwStep2=0, dwData1, dwData2;
SHORT nStatus;
DioCompareData (pdwBuffer1, pdwBuffer2, &dwStep1, &dwStep2, &dwData1, &dwData2, 1000, 0xAA55AA55, 2, &nStatus)
See Also
DioCompareDataWithMaskArray, DioGetErrorString