Skip to content

NI FGEN Configuration Functions

Palash Khare edited this page Jun 3, 2021 · 2 revisions

Configuration Functions

niFgen_ConfigureOperationMode

ViStatus niFgen_ConfigureOperationMode (ViSession vi, ViConstString channelName, ViInt32 operationMode);

Purpose

Determines how the signal generator produces waveforms. NI signal generators support only Continuous operation mode. To control trigger mode, use the niFgen_ConfigureTriggerMode function.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to configure the operation mode.

Defined Value: "0"

operationMode ViInt32

Specifies the operation mode you want the signal generator to use. NI-FGEN sets the NIFGEN_ATTRIBUTE_OPERATION_MODE attribute to this value. NI-FGEN supports only one value.

Defined Value: NIFGEN_VAL_OPERATE_CONTINUOUS

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

niFgen_ConfigureOutputMode

ViStatus niFgen_ConfigureOutputMode (ViSession vi, ViInt32 outputMode);

Purpose

Configures the output mode of the signal generator. The output mode determines how the signal generator produces waveforms. For example, you can select to generate a standard waveform, an arbitrary waveform, or a sequence of arbitrary waveforms.

Note:   The signal generator must not be in the Generating state when you call this function.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
outputMode ViInt32 Specifies the output mode that you want the signal generator to use. The value you specify determines which functions and attributes you can use to configure the waveform the signal generator produces.

Refer to the NIFGEN_ATTRIBUTE_OUTPUT_MODE attribute for more information about setting this parameter.

Default Value: NIFGEN_VAL_OUTPUT_FUNC

Defined Values
NIFGEN_VAL_OUTPUT_FUNC Standard Function mode—Generates standard function waveforms such as sine, square, triangle, and so on.
NIFGEN_VAL_OUTPUT_FREQ_LIST Frequency List mode—Generates a standard function using a list of frequencies you define.
NIFGEN_VAL_OUTPUT_ARB Arbitrary waveform mode—Generates waveforms from user-created/provided waveform arrays of numeric data.
NIFGEN_VAL_OUTPUT_SEQ Arbitrary sequence mode—Generates downloaded waveforms in an order your specify.
NIFGEN_VAL_OUTPUT_SCRIPT Script mode—Allows you to use scripting to link and loop multiple waveforms in complex combinations.

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

niFgen_ConfigureChannels

ViStatus niFgen_ConfigureChannels (ViSession vi, ViConstString channels);

Purpose

Configures the channels to use with the instrument specified in the vi parameter. If you call this function, you must call it immediately after initializing your session and before configuring attributes or writing data.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channels ViConstString Specifies the channel on which all subsequent channel-based attributes in the session are set. Valid values are non-negative integers. For example, 0 is the only valid value on devices with one channel, while devices with two channels support values of 0 and 1. You can specify more than one channel by inserting commas between values (for example, 0,1).

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

niFgen_ConfigureOutputEnabled

ViStatus niFgen_ConfigureOutputEnabled (ViSession vi, ViConstString channelName, ViBoolean enabled);

Purpose

Configures the signal generator to generate a signal at the channel output connector.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to enable the output.

Default Value: "0"

enabled ViBoolean

Specifies whether you want to enable or disable the output. NI-FGEN uses this value to set the NIFGEN_ATTRIBUTE_OUTPUT_ENABLED attribute.

Default Value: VI_TRUE

Defined Values

VI_TRUE Enable the output.
VI_FALSE Disable the output.

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

niFgen_ConfigureOutputImpedance

ViStatus niFgen_ConfigureOutputImpedance (ViSession vi, ViConstString channelName, ViReal64 impedance);

Purpose

Configures the output impedance for the channel you specify.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to set the output impedance.

Default Value: "0"

impedance ViReal64

Specifies the impedance value that you want the signal generator to use. NI-FGEN sets the NIFGEN_ATTRIBUTE_OUTPUT_IMPEDANCE attribute to this value.

Units: Ω (ohms)

Default Value: NIFGEN_VAL_50_OHMS

Defined Values:

NIFGEN_VAL_50_OHMS Specifies that 50 Ω of impedance is used
NIFGEN_VAL_75_OHMS Specifies that 75 Ω of impedance is used

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

niFgen_EnableAnalogFilter

ViStatus niFgen_EnableAnalogFilter (ViSession vi, ViConstString channelName, ViReal64 filterCorrectionFrequency);

Purpose

Configures the analog filter for the device. This function sets the NIFGEN_ATTRIBUTE_ANALOG_FILTER_ENABLED attribute to VI_TRUE. This setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or Script output modes. You also can use this setting in Standard Function and Frequency List output modes for user-defined waveforms.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to enable the analog filter.

Default Value: "0"

filterCorrectionFrequency ViReal64

Specifies the filter correction frequency of the analog filter. On the NI 5411 and NI 5431, NI-FGEN adjusts signal amplitude to compensate for the filter attenuation at that frequency. To disable amplitude correction, set filterCorrectionFrequency to 0. For Standard Function output mode, filterCorrectionFrequency typically should be set to the same value as the frequency of the standard waveform.

Units: hertz

Default Value: 0

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

niFgen_DisableAnalogFilter

ViStatus niFgen_DisableAnalogFilter (ViSession vi, ViConstString channelName);

Purpose

Disables the analog filter. This function sets the NIFGEN_ATTRIBUTE_ANALOG_FILTER_ENABLED attribute to VI_FALSE. This setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or Script output modes. You also can use this setting in Standard Function and Frequency List output modes for user-defined waveforms.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to disable the analog filter.

Default Value: "0"

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

niFgen_EnableDigitalFilter

ViStatus niFgen_EnableDigitalFilter (ViSession vi, ViConstString channelName);

Purpose

Enables the digital filter by setting the NIFGEN_ATTRIBUTE_DIGITAL_FILTER_ENABLED attribute to VI_TRUE. This setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or Script output modes. You also can use this setting in Standard Function and Frequency List output modes for user-defined waveforms.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to enable the digital filter.

Default Value: "0"

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

niFgen_DisableDigitalFilter

ViStatus niFgen_DisableDigitalFilter (ViSession vi, ViConstString channelName);

Purpose

Disables the digital filter. This function sets the NIFGEN_ATTRIBUTE_DIGITAL_FILTER_ENABLED attribute to VI_FALSE. This setting can be applied in Arbitrary Waveform, Arbitrary Sequence, or Script output modes. You also can use this setting in Standard Function and Frequency List output modes for user-defined waveforms.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to disable the digital filter.

Default Value: "0"

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

niFgen_EnableDigitalPatterning

ViStatus niFgen_EnableDigitalPatterning (ViSession vi, ViConstString channelName);

Purpose

Enables digital pattern output on the signal generator. This function sets the NIFGEN_ATTRIBUTE_DIGITAL_PATTERN_ENABLED attribute to VI_TRUE.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to enable the digital pattern output.

Default Value: "0"

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

niFgen_DisableDigitalPatterning

ViStatus niFgen_DisableDigitalPatterning (ViSession vi, ViConstString channelName);

Purpose

Disables digital pattern output on the signal generator. This function sets the NIFGEN_ATTRIBUTE_DIGITAL_PATTERN_ENABLED attribute to VI_FALSE.

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init, niFgen_InitWithOptions, or niFgen_InitializeWithChannels functions and identifies a particular instrument session.
channelName ViConstString

Specifies the channel name for which you want to disable digital pattern output.

Default Value: "0"

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

Table of Contents

Internal Development

Creating and Setting Up a gRPC Server

Server Security Support

Creating a gRPC Client

gRPC Client Examples

Session Utilities API Reference

Driver Documentation

gRPC API Differences From C API

Sharing Driver Sessions Between Clients

C API Docs
NI-DAQmx
NI-DCPOWER
NI-DIGITAL PATTERN DRIVER
NI-DMM
NI-FGEN
NI-FPGA
NI-RFmx Bluetooth
NI-RFmx NR
NI-RFmx WCDMA
NI-RFmx GSM
NI-RFmx CDMA2k
NI-RFmx Instr
NI-RFmx LTE
NI-RFmx SpecAn
NI-RFmx TD-SCDMA
NI-RFmx WLAN
NI-RFSA
NI-RFSG
NI-SCOPE
NI-SWITCH
NI-TCLK
NI-XNET
Clone this wiki locally