niHWS_StoreDigitalWfmU8
C Function Prototype
tHWS_Status niHWS_StoreDigitalWfmU8 (const char filePath[], double rate, const char validSignals[], long compressionLevel, long numSamples, const unsigned char* wfmData, long overwriteExistingFile);
Purpose
Creates a new file for storing digital 8-bit unsigned integer (U8) waveform 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. |
validSignals | const char[] | The list of lines (or bits) in the digital samples that are valid. For example,
"0,3,6" means that only bits 0, 3, and 6 of each unsigned long digital sample
contain valid digital data. The values in the string can receive any integer value between 0 and 7. Individual lines are separated by commas. You can use a hyphen to denote an inclusive range of lines. For example, "2-5" is equivalent to "2,3,4,5". |
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. |
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 numSamples. |
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. |