NI RFmx SpecAn Configuration Functions - ni/grpc-device GitHub Wiki

Configuration Functions

RFmxSpecAn_CfgRF

int32 __stdcall RFmxSpecAn_CfgRF (niRFmxInstrHandle instrumentHandle, char selectorString[], float64 centerFrequency, float64 referenceLevel, float64 externalAttenuation);

Purpose

Configures the RF properties of the signal specified by the selector string.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).
centerFrequency float64 Specifies the carrier frequency, in Hz, of the RF signal that needs to be acquired. The signal analyzer tunes to this frequency.
referenceLevel float64 Specifies the reference level which represents the maximum expected power of the RF input signal. This value is configured in dBm for RF devices and as Vpk-pk for baseband devices. The default of this property is hardware dependent.
externalAttenuation float64 Specifies the attenuation, in dB, of a switch (or cable) connected to the RF IN connector of the signal analyzer. For more information about attenuation, refer to the Attenuation and Signal Levels topic for your device in the NI RF Vector Signal Analyzers Help.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_CfgFrequency

int32 __stdcall RFmxSpecAn_CfgFrequency (niRFmxInstrHandle instrumentHandle, char selectorString[], float64 centerFrequency);

Purpose

Configures the expected carrier frequency of the RF signal to acquire. The signal analyzer tunes to this frequency.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).
centerFrequency float64 Specifies the carrier frequency, in Hz, of the RF signal that needs to be acquired. The signal analyzer tunes to this frequency.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_CfgReferenceLevel

int32 __stdcall RFmxSpecAn_CfgReferenceLevel (niRFmxInstrHandle instrumentHandle, char selectorString[], float64 referenceLevel);

Purpose

Configures the reference level, which represents the maximum expected power of an RF input signal.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).
referenceLevel float64 Specifies the reference level which represents the maximum expected power of the RF input signal. This value is configured in dBm for RF devices and as Vpk-pk for baseband devices. The default of this property is hardware dependent.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_AutoLevel

int32 __stdcall RFmxSpecAn_AutoLevel (niRFmxInstrHandle instrumentHandle, char selectorString[], float64 bandwidth, float64 measurementInterval, float64 *referenceLevel);

Purpose

Examines the incoming signal to calculate the peak power level and sets it as the value of the RFMXSPECAN_ATTR_REFERENCE_LEVEL) attribute. Use this function to help calculate an approximate setting for the reference level.

The RFmxSpecAn_AutoLevel function does the following:

  1. Resets the mixer level, mixer level offset, and IF output power offset.
  2. Sets the starting reference level to the maximum reference level supported by the device based on the current RF attenuation, mechanical attenuation and preamp enabled settings.
  3. Iterates to adjust the reference level based on the input signal peak power.
  4. Uses immediate triggering and restores the trigger settings back to user setting after completing execution.

When using PXIe-5663, 5665, or 5668 devices, NI recommends that you set an appropriate value for mechanical attenuation before calling the RFmxSpecAn_AutoLevel function. Setting an appropriate value for mechanical attenuation reduces the number of times the attenuator settings are changed by this function, thus reducing wear and tear, and maximizing the life time of the attenuator. You can also specify the starting reference level using the RFMXSPECAN_ATTR_AUTO_LEVEL_INITIAL_REFERENCE_LEVEL) attribute.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).
bandwidth float64 Specifies the bandwidth, in Hz, of the signal to be analyzed.
measurementInterval float64 Specifies the acquisition length. Use this value to compute the number of samples to acquire from the signal analyzer. This value is expressed in seconds.
Auto Level VI does not use any trigger for acquisition. It ignores the user-configured trigger properties. NI recommends that you set a sufficiently high measurement interval to ensure that the acquired waveform is at least as long as one period of the signal.
Output
Name Type Description
referenceLevel float64* Returns the estimated peak power level of the input signal. This value is expressed in dBm for RF devices and as Vpk-pk for baseband devices.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_CfgExternalAttenuation

int32 __stdcall RFmxSpecAn_CfgExternalAttenuation (niRFmxInstrHandle instrumentHandle, char selectorString[], float64 externalAttenuation);

Purpose

Specifies the attenuation of a switch (or cable) connected to the RF IN connector of the signal analyzer.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).
externalAttenuation float64 Specifies the attenuation, in dB, of a switch (or cable) connected to the RF IN connector of the signal analyzer. For more information about attenuation, refer to the Attenuation and Signal Levels topic for your device in the NI RF Vector Signal Analyzers Help.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

Trigger

RFmxSpecAn_CfgIQPowerEdgeTrigger

int32 __stdcall RFmxSpecAn_CfgIQPowerEdgeTrigger (niRFmxInstrHandle instrumentHandle, char selectorString[], char IQPowerEdgeSource[], float64 IQPowerEdgeLevel, int32 IQPowerEdgeSlope, float64 triggerDelay, int32 triggerMinQuietTimeMode, float64 triggerMinQuietTimeDuration, int32 enableTrigger);

Purpose

Configures the device to wait for the complex power of the I/Q data to cross the specified threshold and then marks a reference point within the record. To trigger on bursty signals, specify a minimum quiet time, which ensures that the trigger does not occur in the middle of the burst signal. The quiet time must be set to a value smaller than the time between bursts, but large enough to ignore power changes within a burst.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).
IQPowerEdgeSource char[] Specifies the channel from which the device monitors the trigger. The default of this attribute is hardware dependent.
IQPowerEdgeLevel float64 Specifies the power level at which the device triggers. This value is expressed in dB when you set the IQPowerEdgeLevelType parameter to RFMXSPECAN_VAL_IQ_POWER_EDGE_TRIGGER_LEVEL_TYPE_RELATIVE and is expressed in dBm when you set the IQPowerEdgeLevelType parameter to RFMXSPECAN_VAL_IQ_POWER_EDGE_TRIGGER_LEVEL_TYPE_ABSOLUTE. The device asserts the trigger when the signal exceeds the level specified by the value of this parameter, taking into consideration the specified slope. The default of this attribute is hardware dependent.
IQPowerEdgeSlope int32 Specifies whether the device asserts the trigger when the signal power is rising or when it is falling. The device asserts the trigger when the signal power exceeds the specified level with the slope you specify.
RFMXSPECAN_VAL_IQ_POWER_EDGE_RISING_SLOPE (0) The trigger asserts when the signal power is rising.
RFMXSPECAN_VAL_IQ_POWER_EDGE_FALLING_SLOPE (1) The trigger asserts when the signal power is falling.
triggerDelay float64 Specifies the trigger delay time, in seconds.
triggerMinQuietTimeMode int32 Specifies whether the measurement computes the minimum quiet time used for triggering.
RFMXSPECAN_VAL_TRIGGER_MINIMUM_QUIET_TIME_MODE_MANUAL (0) The minimum quiet time used for triggering is the value of the triggerMinQuietTimeDuration parameter.
RFMXSPECAN_VAL_TRIGGER_MINIMUM_QUIET_TIME_MODE_AUTO (1) The measurement computes the minimum quiet time used for triggering.
triggerMinQuietTimeDuration float64 Specifies the duration, in seconds, for which the signal must be quiet before the signal analyzer arms the I/Q Power Edge trigger. If you set the IQPowerEdgeSlope parameter to RFMXSPECAN_VAL_IQ_POWER_EDGE_RISING_SLOPE, the signal is quiet when it is below the trigger level. If you set the IQPowerEdgeSlope parameter to RFMXSPECAN_VAL_IQ_POWER_EDGE_FALLING_SLOPE, the signal is quiet when it is above the trigger level.
enableTrigger int32 Specifies whether to enable the trigger.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_CfgSoftwareEdgeTrigger

int32 __stdcall RFmxSpecAn_CfgSoftwareEdgeTrigger (niRFmxInstrHandle instrumentHandle, char selectorString[], float64 triggerDelay, int32 enableTrigger);

Purpose

Configures the device to wait for a software trigger and then marks a reference point within the record.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).
triggerDelay float64 Specifies the trigger delay time, in seconds.
enableTrigger int32 Specifies whether to enable the trigger.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_CfgDigitalEdgeTrigger

int32 __stdcall RFmxSpecAn_CfgDigitalEdgeTrigger (niRFmxInstrHandle instrumentHandle, char selectorString[], char digitalEdgeSource[], int32 digitalEdge, float64 triggerDelay, int32 enableTrigger);

Purpose

Configures the device to wait for a digital edge trigger and then marks a reference point within the record. Spectral measurements are sometimes implemented with multiple acquisitions and therefore will require that digital triggers are sent for each acquisition. Multiple factors, including the desired span versus the realtime bandwidth of the hardware, affect the number of acquisitions. RFmx recommends repeating the generation until the measurement is completed in order to ensure that all the acquisitions are triggered.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).
digitalEdgeSource char[] Specifies the source terminal for the digital edge trigger. The default of this attribute is hardware dependent.
RFMXSPECAN_VAL_PFI0_STR (PFI0) The trigger is received on PFI 0.
RFMXSPECAN_VAL_PFI1_STR (PFI1) The trigger is received on PFI 1.
RFMXSPECAN_VAL_PXI_TRIG0_STR (PXI_Trig0) The trigger is received on PXI trigger line 0.
RFMXSPECAN_VAL_PXI_TRIG1_STR (PXI_Trig1) The trigger is received on PXI trigger line 1.
RFMXSPECAN_VAL_PXI_TRIG2_STR (PXI_Trig2) The trigger is received on PXI trigger line 2.
RFMXSPECAN_VAL_PXI_TRIG3_STR (PXI_Trig3) The trigger is received on PXI trigger line 3.
RFMXSPECAN_VAL_PXI_TRIG4_STR (PXI_Trig4) The trigger is received on PXI trigger line 4.
RFMXSPECAN_VAL_PXI_TRIG5_STR (PXI_Trig5) The trigger is received on PXI trigger line 5.
RFMXSPECAN_VAL_PXI_TRIG6_STR (PXI_Trig6) The trigger is received on PXI trigger line 6.
RFMXSPECAN_VAL_PXI_TRIG7_STR (PXI_Trig7) The trigger is received on PXI trigger line 7.
RFMXSPECAN_VAL_PXI_STAR_STR (PXI_STAR) The trigger is received on the PXI star trigger line.
RFMXSPECAN_VAL_PXIE_DSTARB_STR (PXIe_DStarB) The trigger is received on the PXIe DStar B trigger line.
RFMXSPECAN_VAL_TIMER_EVENT_STR (TimerEvent) The trigger is received from the timer event.
digitalEdge int32 Specifies the trigger edge to detect.
RFMXSPECAN_VAL_DIGITAL_EDGE_RISING_EDGE (0) The trigger asserts on the rising edge of the signal.
RFMXSPECAN_VAL_DIGITAL_EDGE_FALLING_EDGE (1) The trigger asserts on the falling edge of the signal.
triggerDelay float64 Specifies the trigger delay time, in seconds.
enableTrigger int32 Specifies whether to enable the trigger.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_DisableTrigger

int32 __stdcall RFmxSpecAn_DisableTrigger (niRFmxInstrHandle instrumentHandle, char selectorString[]);

Purpose

Configures the device to not wait for a trigger to mark a reference point within a record. This function defines the signal triggering as immediate.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
selectorString char[] Comprises the signal name. If you do not specify the signal name, the default signal instance is used.

Example:

""

"signal::sig1"

You can use the RFmxSpecAn_BuildSignalString) function to build the selector string).

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_SendSoftwareEdgeTrigger

int32 __stdcall RFmxSpecAn_SendSoftwareEdgeTrigger (niRFmxInstrHandle instrumentHandle);

Purpose

Sends a trigger to the device when you use the RFmxSpecAn Trigger functions to choose a software version of a trigger, and the device is waiting for the trigger to be sent. You can also use this function to override a hardware trigger.

This function returns an error in the following situations:

  • You configure an invalid trigger.
  • You have not previously called the RFmxSpecAn_Initiate) function.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_CfgFrequencyReference

int32 __stdcall RFmxSpecAn_CfgFrequencyReference (niRFmxInstrHandle instrumentHandle, char channelName[], char frequencyReferenceSource[], float64 frequencyReferenceFrequency);

Purpose

Configures the Reference Clock and the frequency reference source.

This function is a wrapper over the RFmx Instruments API, and calls the RFmxInstr_CfgFrequencyReference) function.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
channelName char[] Set this parameter to "" (empty string) or NULL.
frequencyReferenceSource char[] Specifies the frequency reference source.
RFMXSPECAN_VAL_ONBOARD_CLOCK_STR ("Onboard Clock") PXIe-5663/5663E: The RFmx driver locks the PXIe-5663/5663E to the PXIe-5652 LO source onboard clock. Connect the REF OUT2 connector (if it exists) on the PXIe-5652 to the PXIe-5622 CLK IN terminal. On versions of the PXIe-5663/5663E that lack a REF OUT2 connector on the PXIe-5652, connect the REF IN/OUT connector on the PXIe-5652 to the PXIe-5622 CLK IN terminal.

PXIe-5665: The RFmx driver locks the PXIe-5665 to the PXIe-5653 LO source onboard clock. Connect the 100 MHz REF OUT terminal on the PXIe-5653 to the PXIe-5622 CLK IN terminal.

PXIe-5644R/5645R/5646R, PXIe-5840: The RFmx driver locks the device to its onboard clock.
RFMXSPECAN_VAL_REF_IN_STR ("RefIn") PXIe-5663/5663E: Connect the external signal to the PXIe-5652 REF IN/OUT connector. Connect the REF OUT2 connector (if it exists) on the PXIe-5652 to the PXIe-5622 CLK IN terminal.

PXIe-5665: Connect the external signal to the PXIe-5653 REF IN connector. Connect the 100 MHz REF OUT terminal on the PXIe-5653 to the PXIe-5622 CLK IN connector. If your external clock signal frequency is set to a frequency other than 10 MHz, set the frequencyReferenceFrequency parameter according to the frequency of your external clock signal.

PXIe-5644R/5645R/5646R, PXIe-5840: The RFmx driver locks the device to the signal at the external REF IN connector.
RFMXSPECAN_VAL_PXI_CLK_STR ("PXI_Clk") PXIe-5644R/5645R/5646R, PXIe-5663/5663E/5665, PXIe-5840: The RFmx driver locks the PXIe-5644R/5645R/5646R, PXIe-5663/5663E/5665 to the PXI backplane clock.
RFMXSPECAN_VAL_CLK_IN_STR ("ClkIn") PXIe-5663/5663E: The RFmx driver locks the PXIe-5663/5663E to an external 10 MHz signal. Connect the external signal to the PXIe-5622 CLK IN connector, and connect the PXIe-5622 CLK OUT connector to the FREQ REF IN connector on the PXIe-5652.

PXIe-5665: The RFmx driver locks the PXIe-5665 to an external 100 MHz signal. Connect the external signal to the PXIe-5622 CLK IN connector, and connect the PXIe-5622 CLK OUT connector to the REF IN connector on the PXIe-5653. Set the frequencyReferenceFrequency parameter to 100 MHz.

PXIe-5644R/5645R/5646R, PXIe-5840: This configuration does not apply to the PXIe-5644R/5645R/5646R.
frequencyReferenceFrequency float64 Specifies the Reference Clock rate, in Hz, when the frequencyReferenceSource parameter is set to RFMXSPECAN_VAL_CLK_IN_STR or RFMXSPECAN_VAL_REF_IN_STR.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_CfgRFAttenuation

int32 __stdcall RFmxSpecAn_CfgRFAttenuation (niRFmxInstrHandle instrumentHandle, char channelName[], int32 RFAttenuationAuto, float64 RFAttenuationValue);

Purpose

Configures the nominal attenuation and the RFmx driver setting.

This function is a wrapper over the RFmx Instruments API, and calls the RFmxInstr_CfgRFAttenuation) function.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
channelName char[] Set this parameter to "" (empty string) or NULL.
RFAttenuationAuto int32 Specifies whether the RFmx driver computes the RF attenuation.
RFMXSPECAN_VAL_RF_ATTENUATION_AUTO_FALSE (0) Specifies that the RFmx driver uses the value configured using the rfAttenuationValue parameter.
RFMXSPECAN_VAL_RF_ATTENUATION_AUTO_TRUE (1) Specifies that the RFmx driver computes the RF attenuation automatically.
RFAttenuationValue float64 Specifies the nominal attenuation setting, in dB, for all attenuators before the first mixer in the RF signal chain when the rfAttenuationAuto parameter is set to RFMXSPECAN_VAL_RF_ATTENUATION_AUTO_FALSE.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

RFmxSpecAn_CfgMechanicalAttenuation

int32 __stdcall RFmxSpecAn_CfgMechanicalAttenuation (niRFmxInstrHandle instrumentHandle, char channelName[], int32 mechanicalAttenuationAuto, float64 mechanicalAttenuationValue);

Purpose

Configures the mechanical attenuation and the RFmx driver attenuation hardware settings.

This function is a wrapper over the RFmx Instruments API, and calls the RFmxInstr_CfgMechanicalAttenuation) function.

Parameters

Input
Name Type Description
instrumentHandle niRFmxInstrHandle Identifies the RFmx session. You can obtain this parameter from the RFmxSpecAn_Initialize) function.
channelName char[] Set this parameter to "" (empty string) or NULL.
mechanicalAttenuationAuto int32 Specifies whether the RFmx driver automatically chooses an attenuation setting based on the hardware settings.
RFMXSPECAN_VAL_MECHANICAL_ATTENUATION_AUTO_FALSE (0) Specifies that the RFmx driver uses the value configured in the mechanicalAttenuationValue parameter.
RFMXSPECAN_VAL_MECHANICAL_ATTENUATION_AUTO_TRUE (1) Specifies that the measurement computes the mechanical attenuation.
mechanicalAttenuationValue float64 Specifies the level of mechanical attenuation, in dB, for the RF path when the mechanicalAttenuationAuto is set to RFMXSPECAN_VAL_MECHANICAL_ATTENUATION_AUTO_FALSE.

Return Value

Name Type Description
status int32 Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an RFmx function to determine if an error has occurred.

To obtain a text description of the status code and additional information about the error condition, call the RFmxSpecAn_GetError) function.

The general meaning of the status code is as follows:
Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors
⚠️ **GitHub.com Fallback** ⚠️