DioCompareDataWithMaskArray

Applies To

General utility function, not board related.

Purpose

Compares two arrays with a mask array values, returns the first value for both arrays that differ.

Syntax

DioCompareDataWithMaskArray (pvBuffer1, pvBuffer2, pdwStep1, pdwStep2, pvData1, pvData2, dwSize, pvMaskBuffer, pdwMaskStep nDataWidth, pnStatus)

Parameters

Name

Type

Comments

pvBuffer1

PVOID

First buffer

pvBuffer2

PVOID

Second buffer

pdwStep1

PDWORD

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.

pvMaskBuffer

PVOID

Mask buffer values when comparing values.

pdwMaskStep

PDWORD

Starting step for the mask buffer. Returns the failed step number on comparison fail, or –1 on success.

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 of two buffers while using a mask array:

 

DWORD dwStep1=0, dwStep2=0, dwMaskStep=0, dwData1, dwData2;

SHORT nStatus;

DioCompareData (pdwBuffer1, pdwBuffer2, &dwStep1, &dwStep2, &dwData1, &dwData2, 1000, pvMaskBuffer, dwMaskStep, 2, &nStatus)

 

See Also

DioCompareData, DioGetErrorString