niHSDIO_WriteNamedWaveformFromFileHWS

NI Digital Waveform Generator/Analyzer

niHSDIO_WriteNamedWaveformFromFileHWS

Specific Function

C Function Prototype

ViStatus niHSDIO_WriteNamedWaveformFromFileHWS  (ViSession vi, ViConstString waveformName, ViConstString filePath, ViBoolean useRateFromWaveform, ViInt32* waveformSize);

Purpose

Reads and transfers data from a digital .hws file to onboard memory.

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 re-create 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.
filePath ViConstString Specifies the path and file name of the digital .hws file to open. The .hws extension is typically used for .hws files, although using this extension is optional.
useRateFromWaveform ViBoolean Controls how the sample rate is computed.

Setting this value to TRUE computes the generation rate from the WDT value. If the sample rate has been configured using niHSDIO_ConfigureSampleClock function, useRateFromWaveform overrides the sample rate.
waveformSize ViInt32 Returns the number of samples contained in the waveform.

Return Value