niHSDIO_WriteNamedWaveformU8

NI Digital Waveform Generator/Analyzer

niHSDIO_WriteNamedWaveformU8

Specific Function

C Function Prototype

ViStatus niHSDIO_WriteNamedWaveformU8 (ViSession vi, ViConstString waveformName, ViInt32 samplesToWrite, ViUInt8[] 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 1.

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's 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. Thus, subsequent calls to this function append data to the end of previously written data. You may also manually change the write position by calling niHSDIO_SetNamedWaveformNextWritePosition. If you try to write past the end of the allocated space, an error will be returned.

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_WriteNamedWaveformU8 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.
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.
data ViUInt8[] 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