niHSDIO_WriteNamedWaveformWDT

NI Digital Waveform Generator/Analyzer

niHSDIO_WriteNamedWaveformWDT

Specific Function

C Function Prototype

ViStatus niHSDIO_WriteNamedWaveformWDT (ViSession vi, ViConstString waveformName, ViInt32 samplesToWrite, ViInt32 dataLayout, ViUInt8[] data);

Purpose

Transfers multistate digital waveforms from PC memory to onboard memory. Each element of data[] uses one byte per channel per sample. The supported values are defined in niHSDIO.h.

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 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.

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. This number is not equal to the length of the data[] array, since its size is the number of samples to write times the number of channels.
dataLayout ViInt32 Describes the layout of the waveform contained in data[].

Defined Values

NIHSDIO_VAL_GROUP_BY_SAMPLE—Specifies that consecutive samples in data[] 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.
NIHSDIO_VAL_GROUP_BY_CHANNEL—Specifies that consecutive samples in data[] 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.
data ViUInt8[] Specifies the digital waveform data. Each value on this array defines the state of one channel of one sample. Supported states are defined in niHSDIO.h

Return Value