niFgen_CreateWaveformFromFileI16

NI-FGEN C Function

niFgen_CreateWaveformFromFileI16

ViStatus niFgen_CreateWaveformFromFileI16 (ViSession vi, ViConstString channelName, ViConstString filename, ViInt32 byteOrder, ViInt32* waveformHandle);

Purpose

Takes the binary I16 data from the specified file and creates an onboard waveform for use in Arbitrary Waveform or Arbitrary Sequence output mode. The waveformHandle returned can later be used for setting the active waveform, changing the data in the waveform, building sequences of waveforms, or deleting the waveform when it is no longer needed.

Notes   The i16 data (values between -32768 and +32767) is assumed to represent -1 to +1 V. Use the NIFGEN_ATTR_DIGITAL_GAIN attribute to generate different voltage outputs.
You must call the niFgen_ConfigureOutputMode function to set the outputMode parameter to NIFGEN_VAL_OUTPUT_ARB or NIFGEN_VAL_OUTPUT_SEQ before calling this function.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init or the niFgen_InitWithOptions functions and identifies a particular instrument session.
channelName ViConstString Specifies the channel name for which you want to create the waveform.

Default Value: "0"

fileName ViConstString The full path and name of the file where the waveform data resides.

byteOrder ViInt32 Specifies the byte order of the data in the file.
Note Note  Data written by most applications in Windows (including LabWindows/CVI) is in Little Endian format. Data written to a file from LabVIEW is in Big Endian format by default on all platforms. (Big Endian and Little Endian refer to the way data is stored in memory, which can differ on different processors.)

Defined Values

NIFGEN_VAL_LITTLE_ENDIAN Little Endian Data—the least significant bit is stored at the lowest address, followed by the other bits, in order of increasing significance.
NIFGEN_VAL_BIG_ENDIAN Big Endian Data—the most significant bit is stored at the lowest address, followed by the other bits, in order of decreasing significance.


Default Value: NIFGEN_VAL_LITTLE_ENDIAN
Output
Name Type Description
waveformHandle ViInt32* The handle that identifies the new waveform. This handle is used later when referring to this waveform.

Return Value

Name Type Description
Status ViStatus Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors