niHWS_StoreDigitalWfm2DU16

NI-HWS C Function Reference

niHWS_StoreDigitalWfm2DU16

Specific Function

C Function Prototype

tHWS_Status niHWS_StoreDigitalWfm2DU16  (const char filePath[], double rate, long compressionLevel, long numRows, long numSamplesPerRow, const unsigned short* wfmData, long overwriteExistingFile);

Purpose

Creates a new file for storing a two-dimensional array of digital 16-bit (U16) 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.

numRows long The number of rows the new waveform contains.
numSamplesPerRow long The number of samples the new waveform contains.
wfmData const unsigned short* 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 numSamplesPerRow parameter times the number of rows.
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