niHWS_ReadAnalogI16

NI-HWS C Function Reference

niHWS_ReadAnalogI16

C Function Prototype

tHWS_Status niHWS_ReadAnalogI16 (tHWS_WfmRef wfmReference, long numSamplesToRead, short* wfmBuffer, long* actualSamplesRead);

Purpose

Returns analog waveform samples as 16-bit signed integers (I16) beginning at the current read/write position. Only data stored as 8- or 16-bit signed integers (chars or shorts) can be retrieved with this function. 8-bit data is sign-extended to 16 bits.

A read moves the read/write position so that it points to the next unread sample in the waveform.

Parameters

Name Type Description
wfmReference tHWS_WfmRef A reference to the waveform. Waveforms are identified by reference for purposes of setting and getting waveform attributes and reading and writing data.
numSamplesToRead long Specifies how many samples to read into wfmBuffer.

If numSamplesToRead is 0, the number of samples in the waveform is returned in actualSamplesRead.

wfmBuffer short* The array that contains the data for the waveform. It is assumed that this array is big enough to contain at least the amount of data indicated by the value assigned to numSamplesToRead.
actualSamplesRead long* Reports the number of samples read.

If numSamplesToRead is 0, the number of samples in the waveform is returned in actualSamplesRead.

Return Value