niHWS_StoreDigitalWfmWDT

NI-HWS C Function Reference

niHWS_StoreDigitalWfmWDT

C Function Prototype

tHWS_Status niHWS_StoreDigitalWfmWDT (const char filePath[], double rate, long compressionLevel, tHWS_DigitalWDTDataLayout data_layout, long number_ofSignals, long number_ofSamples, const unsigned char* waveformData, long overwriteExistingFile);

Purpose

Creates a new file for storing digital waveform data type (WDT) data.

This function is intended for storing a single waveform in a file. To store multiple waveforms in a file, use the Low Level functions.

Parameters

Name Type Description
filePath const char[] Specifies the path and filename of the HWS file to create or open. The .hws extension is typically used for HWS files, although using this extension is optional.
rate double The rate of the Sample clock used to capture the waveform.
compressionLevel long This parameter provides control over the amount of compression applied to the waveform samples as they are written to the HWS file.

A value of 0 means no compression. A value of 9 means maximum compression. Values between zero and nine indicate increasing levels of compression.

dataLayout tHWS_DigitalWDTDataLayout Describes the layout of the waveform data.

Defined Values

niHWS_Val_GroupBySample—specifies that consecutive samples in wfmData 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.
niHWS_Val_GroupBySignal—specifies that consecutive samples in wfmData 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.
numSignals long The number of signals the new waveform contains.
numSamples long The number of samples the new waveform contains.
wfmData const unsigned char* Contains the data for the waveform. This array must be large enough to contain at least the amount of data indicated by the value assigned to the numSamples parameter times numSignals.
overwriteExistingFile long Allows this function to overwrite the file if it exists.

Set to 1 to overwrite the existing file and create a new file.

Set to 0 to prevent overwriting an existing file.

Return Value