niHSDIO_FetchWaveformDirectDMA

NI Digital Waveform Generator/Analyzer

niHSDIO_FetchWaveformDirectDMA

Specific Function

C Function Prototype

ViStatus niHSDIO_FetchWaveformDirectDMA (ViSession vi, ViInt32 maxTimeMilliseconds, ViInt32 samplesToRead, ViUint32 bufferSize, void bufferAddress, niHSDIO_wfmInfo waveformInfo, ViUInt32* offsetToFirstSample;

Purpose

Transfers acquired waveform data from device memory directly to PC memory allocated by a Direct DMA-compatible device. The size of the sample that is transferred is determined by the the data width for your device.

If the number of samples specified in samplesToRead is still not available after the number of milliseconds specified in maxTimeMilliseconds, this function returns no data with a timeout error.

The fetch position can be modified by using niHSDIO_SetAttributeViInt32 and the NIHSDIO_ATTR_FETCH_RELATIVE_TO or NIHSDIO_ATTR_FETCH_OFFSET attributes. The default value for NIHSDIO_ATTR_FETCH_RELATIVE_TO is NIHSDIO_VAL_CURRENT_READ_POSITION. The default value for NIHSDIO_ATTR_FETCH_OFFSET is 0.

Parameters

Name Type Description
vi ViSession This handle identifies your instrument session. vi was obtained from niHSDIO_InitAcquisitionSession.
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 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.
samplesToRead ViInt32 Specifies the number of samples to fetch.
bufferSize ViUInt32 Specifies the size (in bytes) of the buffer in memory at which to transfer acquired data.
bufferAddress void Specifies the location for the buffer in memory at which to transfer acquired data.
waveformInfo niHSDIO_wfmInfo Returns the absolute and relative timestamp for the operation, the dt, and the actual number of samples read.
offsetToFirstSample ViUInt32* Returns the offset of the first sample acquired within the specified buffer. Data is transfered from device memory in 128 byte increments, so the first sample of the acquired data typically occurs at some offset from the start of the buffer when using a Reference trigger.

Return Value