niHWS_ReadDigitalWDT
C Function Prototype
tHWS_Status niHWS_ReadDigitalWDT (tHWS_WfmRef waveformReference, tHWS_DigitalWDTDataLayout data_layout, long number_ofSamples_toRead, unsigned char* waveformData, long *actualSamplesRead);
Purpose
Returns digital waveform samples as a waveform data type, beginning at the current read/write position.
A read moves the read/write position so that it points to the next unread sample in the waveform.
The digital waveform is an array of chars where each char represents a single bit of a waveform. If dataLayout is configured for niHWS_Val_GroupBySample, then all the bits for the first sample are in the first elements of the array, all the bits for the next sample are in the next elements, and so on. If dataLayout is configured for niHWS_Val_GroupBySignal, then the first range of elements in the array contains the bit 0 values for each sample, the next set of array elements contain the bit 1 values for each sample, and so on.
Each bit is represented by a char because a bit can be any of the following eight different values: H, L, 0, 1, X, Z, V, T.
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. |
dataLayout | tHWS_DigitalWDTDataLayout | Describes the layout of the waveform data. Defined Values NIHWS_VAL_GROUP_BY_SAMPLE—specifies that consecutive samples in wfmBuffer are such that the array contains the first sample from every signal in the operation, then the second sample from every signal, up to the last sample from every signal. NIHWS_VAL_GROUP_BY_SIGNAL—specifies that consecutive samples in wfmBuffer are such that the array contains all the samples from the first signal in the operation, then all the samples from the second signal, up to all samples from the last signal. |
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 | unsigned char* | 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 times the total number of signals. |
actualSamplesRead | long* | Reports the number of samples read.
If numSamplesToRead is 0, the number of samples in the waveform is returned in actualSamplesRead. |