niHSDIO_ReadWaveformU8

NI Digital Waveform Generator/Analyzer

niHSDIO_ReadWaveformU8

Specific Function

C Function Prototype

ViStatus niHSDIO_ReadWaveformU8 (ViSession vi, ViInt32 samplesToRead, ViInt32 maxTimeMilliseconds, ViInt32* numberOfSamplesRead, ViUInt8[] data);

Purpose

Initiates a waveform acquisition on channels enabled for dynamic acquisition, waits until it acquires the number of samples in samplesToRead, and returns the acquired binary data.

Parameters

Name Type Description
vi ViSession This handle identifies your instrument session. vi was obtained from niHSDIO_InitAcquisitionSession.
samplesToRead ViInt32 Specifies the number of samples to fetch.
maxTimeMilliseconds ViInt32 Specifies in milliseconds how long to allow the function to complete before returning a timeout error.

A value of 0 causes the function to return immediately with up to the number of samples specified in samplesToRead. If you set maxTimeMilliseconds to a value other than 0, and a timeout occurs before all the samples are acquired, you receive a timeout error. If you specify a value for samplesToRead that is greater than the number of samples in the device memory, NI-HSDIO returns the available samples after maxTimeMilliseconds. A value of -1 causes the function to never time out.
numberOfSamplesRead ViInt32 Returns the number of samples that were successfully fetched and transferred into data[].
data ViUInt8[] Returns the preallocated array where samples are written.

Return Value