# cbFileRead()

Reads data from a streamer file. When cbFileAInScan() or cbFilePretrig() fills the streamer file, this function returns the content of that file. Refer to information on your board in the Universal Library User's Guide to determine if your board supports cbFileAInScan() and/or cbFilePretrig().

## Function Prototype

C/C++

int cbFileRead(char *FileName, long FirstPoint, long *NumPoints, int *DataBuffer)

Visual Basic

Function cbFileRead(ByVal FileName$, ByVal FirstPoint&, NumPoints&, DataBuffer%) As Long

## Arguments

FileName

Name of the streamer file.

FirstPoint

Index of the first point to read.

NumPoints

Number of points to read from the file.

DataBuffer

Pointer to the data buffer that data will be read into.

## Returns

- Error code or 0 if no errors
- DataBuffer – data read from file.
- NumPoints – number of points actually read.
- NumPoints may be less than the requested number of points if an error occurs.

## Notes

- Data format – The data is returned as 16 bits. The 16 bits may represent 12 bits of analog, 12 bits of analog plus 4 bits of channel, or 16 bits of analog. Use cbAConvertData() to correctly load the data into an array.
- Loading portions of files – The file may contain much more data than can fit in DataBuffer. In those cases, use NumPoints and FirstPoint to read a selected piece of the file into DataBuffer. Call cbFileGetInfo() first to find out how many points are in the file.