niHSDIO_WriteNamedWaveformU32

NI Digital Waveform Generator/Analyzer

niHSDIO_WriteNamedWaveformU32

Specific Function

C Function Prototype

ViStatus niHSDIO_WriteNamedWaveformU32 (ViSession vi, ViConstString waveformName, ViInt32 samplesToWrite, ViUInt32[] data);

Purpose

Transfers waveform data from PC memory to onboard memory. Supported devices for this function depend on the data width for your device, not on the number of assigned dynamic channels. This function may be used when the data width is 4.

If you specify a waveformName not already allocated on the device, the appropriate amount of onboard memory is allocated (if available), and the data is stored in that new location.

Data is always written to memory starting at the current write position of the waveform. A new waveform write position is the start of the allocated memory. Calling this function moves the next write position to the end of the data just written, so subsequent calls to this function append data to the end of previously written data. You can manually change the write position by calling niHSDIO_SetNamedWaveformNextWritePosition. If you try to write past the end of the allocated space, NI-HSDIO returns an error.

Waveforms are stored contiguously in onboard memory. You cannot resize an existing named waveform. Instead, delete the existing waveform using niHSDIO_DeleteNamedWaveform and then recreate it with the new size using the same name.

This function calls niHSDIO_CommitDynamic— all pending attributes are committed to hardware.

When you explicitly call niHSDIO_AllocateNamedWaveform and write waveforms using multiple niHSDIO_WriteNamedWaveformU32 calls, each waveform block written must be a multiple of 32 samples for the NI 654x/655x devices or a multiple of 64 samples for the NI 656x devices (128 samples if the NI 656x is in DDR mode).

Parameters

Name Type Description
vi ViSession This handle identifies your instrument session. vi was obtained from niHSDIO_InitGenerationSession.
waveformName ViConstString Specifies a string representing the name to associate with the allocated waveform memory.

Default Value: "" (empty string)
samplesToWrite ViInt32 Specifies the number of samples in data to be written to onboard memory.

If samples to write is less than the size of data, only the number of samples indicated in samplesToWrite are written.

Default Value: 1000
data ViUInt32[] Specifies the waveform data.

If you want to use Direct DMA to write your waveform from onboard memory, pass the memory address (pointer value) of the region so that you write within the direct DMA window.

Return Value