cbAConvertPretrigData()

For products with pretrigger implemented in hardware (most products), this function converts and aligns the raw data collected by cbAPretrig(). The cbAPretrig() function can return either raw A/D data or converted data, depending on whether or not the CONVERTDATA option was used. The raw data as it is collected is not in the correct order. After the data collection is completed it must be rearranged into the correct order. This function correctly orders the data also, starting with the first pretrigger data point and ending with the last post-trigger point.

Function Prototype

C/C++

int cbAConvertPretrigData(int BoardNum, long PretrigCount, long TotalCount, unsigned short ADData[], unsigned short ChanTags[])

Visual Basic

Function cbAConvertPretrigData(ByVal BoardNum&, ByVal PretrigCount&, ByVal TotalCount&, ADData%, ChanTags%) As Long

Arguments

BoardNum

The number associated with the board when it was installed with InstaCal or created with cbCreateDaqDevice(). BoardNum may be 0 to 99.

PretrigCount

Number of pre-trigger samples. This value must match the value returned by the PretrigCount argument in the cbAPretrig() function.

TotalCount

Total number of samples that were collected.

ADData

Pointer to the data array. this value must match the array name used in the cbAPretrig() function.

ChanTags

Pointer to the channel tag array or a NULL pointer may be passed if using 16-bit boards or if channel tags are not desired; see the note regarding 16-bit boards below.

Returns

Notes

Visual Basic Programmers

After the data is collected with cbAPretrig() it must be copied to an array with cbWinBufToArray().

Important: The entire array must be copied. This array includes the extra 512 samples needed by cbAPretrig(). Example code is given below:

Count& = 10000

Dim ADData%(Count& + 512)
Dim ChanTags%(Count& + 512)

cbAPretrig%(BoardNum, LowChan, HighChan, PretrigCount&, Count&...)

cbWinBufToArray%(MemHandle%, ADData%, Count& + 512)

cbAConvertPretrigData%(PretrigCount&, Count&, ADData%, ChanTags%)