"""Provides methods to configure the Acp measurement."""
import functools
import nirfmxwcdma.attributes as attributes
import nirfmxwcdma.enums as enums
import nirfmxwcdma.errors as errors
import nirfmxwcdma.internal._helper as _helper
def _raise_if_disposed(f):
"""From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""
@functools.wraps(f)
def aux(*xs, **kws):
meas_obj = xs[0] # parameter 0 is 'self' which is the measurement object
if meas_obj._signal_obj.is_disposed:
raise Exception("Cannot access a disposed Wcdma signal configuration")
return f(*xs, **kws)
return aux
[docs]
class AcpConfiguration(object):
"""Provides methods to configure the Acp measurement."""
def __init__(self, signal_obj):
"""Provides methods to configure the Acp measurement."""
self._signal_obj = signal_obj
self._session_function_lock = signal_obj._session_function_lock
self._interpreter = signal_obj._interpreter
[docs]
@_raise_if_disposed
def get_measurement_enabled(self, selector_string):
r"""Gets whether to enable the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (bool):
Specifies whether to enable the ACP measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_MEASUREMENT_ENABLED.value
)
attr_val = bool(attr_val)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_enabled(self, selector_string, value):
r"""Sets whether to enable the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
value (bool):
Specifies whether to enable the ACP measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_MEASUREMENT_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_carrier_integration_bandwidth(self, selector_string):
r"""Gets the frequency range over which the measurement integrates the carrier power. This value is expressed in Hz.
Use "carrier<*n*>" as the selector string to read this attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the frequency range over which the measurement integrates the carrier power. This value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string,
attributes.AttributeID.ACP_CARRIER_INTEGRATION_BANDWIDTH.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_number_of_offsets(self, selector_string):
r"""Gets the number of offset channels.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 2.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of offset channels.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_NUMBER_OF_OFFSETS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_offsets(self, selector_string, value):
r"""Sets the number of offset channels.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 2.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of offset channels.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_NUMBER_OF_OFFSETS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_offset_frequency(self, selector_string):
r"""Gets the center frequency of the offset channel, relative to the center frequency of the carrier(s). This value is
expressed in Hz.
Use "offset<*n*>" as the selector string to read this attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the center frequency of the offset channel, relative to the center frequency of the carrier(s). This value is
expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ACP_OFFSET_FREQUENCY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_offset_power_reference_carrier(self, selector_string):
r"""Gets the carrier used as the power reference to measure the offset channel relative power.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Composite**.
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==========================================================================================================================+
| Closest (0) | The measurement uses the carrier power closest to the center frequency of the offset channel as the power reference. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Highest (1) | The measurement uses the highest measured active carrier power as the power reference. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Composite (2) | The measurement uses total measured active carrier power as the power reference. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Specific (3) | The measurement uses the power measured in the carrier with index specified by the ACP Offset Pwr Ref Specific |
| | attribute as the power reference. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpOffsetPowerReferenceCarrier):
Specifies the carrier used as the power reference to measure the offset channel relative power.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_OFFSET_POWER_REFERENCE_CARRIER.value,
)
attr_val = enums.AcpOffsetPowerReferenceCarrier(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_offset_power_reference_carrier(self, selector_string, value):
r"""Sets the carrier used as the power reference to measure the offset channel relative power.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Composite**.
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==========================================================================================================================+
| Closest (0) | The measurement uses the carrier power closest to the center frequency of the offset channel as the power reference. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Highest (1) | The measurement uses the highest measured active carrier power as the power reference. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Composite (2) | The measurement uses total measured active carrier power as the power reference. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Specific (3) | The measurement uses the power measured in the carrier with index specified by the ACP Offset Pwr Ref Specific |
| | attribute as the power reference. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpOffsetPowerReferenceCarrier, int):
Specifies the carrier used as the power reference to measure the offset channel relative power.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpOffsetPowerReferenceCarrier else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_OFFSET_POWER_REFERENCE_CARRIER.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_offset_power_reference_specific(self, selector_string):
r"""Gets the index of the reference carrier.
The measured power of this carrier is the power reference for the offset channel relative power measurement if
you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_OFFSET_POWER_REFERENCE_CARRIER` attribute to
**Specific**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0. Valid values of this attribute are 0 to (*Value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.NUMBER_OF_CARRIERS` property* - 1), inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the index of the reference carrier.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_OFFSET_POWER_REFERENCE_SPECIFIC.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_offset_power_reference_specific(self, selector_string, value):
r"""Sets the index of the reference carrier.
The measured power of this carrier is the power reference for the offset channel relative power measurement if
you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_OFFSET_POWER_REFERENCE_CARRIER` attribute to
**Specific**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0. Valid values of this attribute are 0 to (*Value of the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.NUMBER_OF_CARRIERS` property* - 1), inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the index of the reference carrier.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_OFFSET_POWER_REFERENCE_SPECIFIC.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_offset_integration_bandwidth(self, selector_string):
r"""Gets the frequency range, over which the measurement integrates the offset channel power. This value is expressed in
Hz.
Use "offset<*n*>" as the selector string to read this attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the frequency range, over which the measurement integrates the offset channel power. This value is expressed in
Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string,
attributes.AttributeID.ACP_OFFSET_INTEGRATION_BANDWIDTH.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_rbw_filter_auto_bandwidth(self, selector_string):
r"""Gets whether the measurement computes the RBW.
This attribute is valid only if you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_RBW_FILTER_TYPE`
attribute to **Gaussian** or **Flat**.
If you set the ACP RBW Filter Type attribute to **FFT Based**, the measurement calculates the RBW regardless of
the value of this attribute.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+-------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+=========================================================================+
| False (0) | The measurement uses the RBW that you specify in the ACP RBW attribute. |
+--------------+-------------------------------------------------------------------------+
| True (1) | The measurement calculates the RBW. |
+--------------+-------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpRbwAutoBandwidth):
Specifies whether the measurement computes the RBW.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_RBW_FILTER_AUTO_BANDWIDTH.value
)
attr_val = enums.AcpRbwAutoBandwidth(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_rbw_filter_auto_bandwidth(self, selector_string, value):
r"""Sets whether the measurement computes the RBW.
This attribute is valid only if you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_RBW_FILTER_TYPE`
attribute to **Gaussian** or **Flat**.
If you set the ACP RBW Filter Type attribute to **FFT Based**, the measurement calculates the RBW regardless of
the value of this attribute.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+-------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+=========================================================================+
| False (0) | The measurement uses the RBW that you specify in the ACP RBW attribute. |
+--------------+-------------------------------------------------------------------------+
| True (1) | The measurement calculates the RBW. |
+--------------+-------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpRbwAutoBandwidth, int):
Specifies whether the measurement computes the RBW.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpRbwAutoBandwidth else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_RBW_FILTER_AUTO_BANDWIDTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_rbw_filter_bandwidth(self, selector_string):
r"""Gets the bandwidth of the RBW filter used to sweep the acquired signal when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_RBW_FILTER_AUTO_BANDWIDTH` attribute to **False**.
This attribute is valid only if you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_RBW_FILTER_TYPE`
attribute to **Gaussian** or **Flat**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 38.4 kHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the bandwidth of the RBW filter used to sweep the acquired signal when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_RBW_FILTER_AUTO_BANDWIDTH` attribute to **False**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ACP_RBW_FILTER_BANDWIDTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_rbw_filter_bandwidth(self, selector_string, value):
r"""Sets the bandwidth of the RBW filter used to sweep the acquired signal when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_RBW_FILTER_AUTO_BANDWIDTH` attribute to **False**.
This attribute is valid only if you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_RBW_FILTER_TYPE`
attribute to **Gaussian** or **Flat**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 38.4 kHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the bandwidth of the RBW filter used to sweep the acquired signal when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_RBW_FILTER_AUTO_BANDWIDTH` attribute to **False**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.ACP_RBW_FILTER_BANDWIDTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_rbw_filter_type(self, selector_string):
r"""Gets the shape of the digital RBW filter.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **FFT Based**.
+---------------+----------------------------------------------------+
| Name (Value) | Description |
+===============+====================================================+
| FFT Based (0) | No RBW filtering is used. |
+---------------+----------------------------------------------------+
| Gaussian (1) | An RBW filter with a Gaussian response is applied. |
+---------------+----------------------------------------------------+
| Flat (2) | An RBW filter with a flat response is applied. |
+---------------+----------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpRbwFilterType):
Specifies the shape of the digital RBW filter.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_RBW_FILTER_TYPE.value
)
attr_val = enums.AcpRbwFilterType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_rbw_filter_type(self, selector_string, value):
r"""Sets the shape of the digital RBW filter.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **FFT Based**.
+---------------+----------------------------------------------------+
| Name (Value) | Description |
+===============+====================================================+
| FFT Based (0) | No RBW filtering is used. |
+---------------+----------------------------------------------------+
| Gaussian (1) | An RBW filter with a Gaussian response is applied. |
+---------------+----------------------------------------------------+
| Flat (2) | An RBW filter with a flat response is applied. |
+---------------+----------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpRbwFilterType, int):
Specifies the shape of the digital RBW filter.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpRbwFilterType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_RBW_FILTER_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_sweep_time_auto(self, selector_string):
r"""Gets whether the measurement computes the sweep time.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+-------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+=====================================================================================+
| False (0) | The measurement uses the sweep time that you specify in the ACP Sweep Time property |
+--------------+-------------------------------------------------------------------------------------+
| True (1) | The measurement uses a sweep time value of one slot duration. |
+--------------+-------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpSweepTimeAuto):
Specifies whether the measurement computes the sweep time.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_SWEEP_TIME_AUTO.value
)
attr_val = enums.AcpSweepTimeAuto(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_sweep_time_auto(self, selector_string, value):
r"""Sets whether the measurement computes the sweep time.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+-------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+=====================================================================================+
| False (0) | The measurement uses the sweep time that you specify in the ACP Sweep Time property |
+--------------+-------------------------------------------------------------------------------------+
| True (1) | The measurement uses a sweep time value of one slot duration. |
+--------------+-------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpSweepTimeAuto, int):
Specifies whether the measurement computes the sweep time.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpSweepTimeAuto else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_SWEEP_TIME_AUTO.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_sweep_time_interval(self, selector_string):
r"""Gets the sweep time when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_SWEEP_TIME_AUTO` attribute
to **False**.
This value is expressed in seconds.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 666.66666700000007 microseconds.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the sweep time when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_SWEEP_TIME_AUTO` attribute
to **False**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ACP_SWEEP_TIME_INTERVAL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_sweep_time_interval(self, selector_string, value):
r"""Sets the sweep time when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_SWEEP_TIME_AUTO` attribute
to **False**.
This value is expressed in seconds.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 666.66666700000007 microseconds.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the sweep time when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_SWEEP_TIME_AUTO` attribute
to **False**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string, attributes.AttributeID.ACP_SWEEP_TIME_INTERVAL.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_method(self, selector_string):
r"""Gets the method for performing the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Normal**.
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+====================+==========================================================================================================================+
| Normal (0) | The ACP measurement acquires the spectrum using the same signal analyzer setting across frequency bands. Use this |
| | method when measurement speed is desirable over higher dynamic range. |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
| Dynamic Range (1) | The ACP measurement acquires the spectrum using the hardware-specific optimizations for different frequency bands. Use |
| | this method to get the best dynamic range. |
| | |
| | **Supported Devices**: PXIe-5665/5668R |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
| Sequential FFT (2) | The ACP measurement acquires I/Q samples for a duration specified by the ACP Sweep Time attribute. These samples are |
| | divided into smaller chunks. The size of each chunk is defined by the ACP Sequential FFT Size attribute and FFT is |
| | computed on each of these chunks. The resultant FFTs are averaged to get the spectrum and is used to compute ACP. If |
| | the total acquired samples is not an integer multiple of the FFT size, the remaining samples at the end of acquisition |
| | are not used for the measurement. Use this method to optimize ACP measurement speed. Accuracy of the results may be |
| | reduced when using this measurement method. |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpMeasurementMethod):
Specifies the method for performing the ACP measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_MEASUREMENT_METHOD.value
)
attr_val = enums.AcpMeasurementMethod(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_method(self, selector_string, value):
r"""Sets the method for performing the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Normal**.
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+====================+==========================================================================================================================+
| Normal (0) | The ACP measurement acquires the spectrum using the same signal analyzer setting across frequency bands. Use this |
| | method when measurement speed is desirable over higher dynamic range. |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
| Dynamic Range (1) | The ACP measurement acquires the spectrum using the hardware-specific optimizations for different frequency bands. Use |
| | this method to get the best dynamic range. |
| | |
| | **Supported Devices**: PXIe-5665/5668R |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
| Sequential FFT (2) | The ACP measurement acquires I/Q samples for a duration specified by the ACP Sweep Time attribute. These samples are |
| | divided into smaller chunks. The size of each chunk is defined by the ACP Sequential FFT Size attribute and FFT is |
| | computed on each of these chunks. The resultant FFTs are averaged to get the spectrum and is used to compute ACP. If |
| | the total acquired samples is not an integer multiple of the FFT size, the remaining samples at the end of acquisition |
| | are not used for the measurement. Use this method to optimize ACP measurement speed. Accuracy of the results may be |
| | reduced when using this measurement method. |
+--------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpMeasurementMethod, int):
Specifies the method for performing the ACP measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpMeasurementMethod else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_MEASUREMENT_METHOD.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_noise_compensation_enabled(self, selector_string):
r"""Gets whether to enable compensation of the channel powers for the inherent noise floor of the signal analyzer.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | Disables compensation of the channel powers for the noise floor of the signal analyzer. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | Enables compensation of the channel powers for the noise floor of the signal analyzer. The noise floor of the signal |
| | analyzer is measured for the RF path used by the ACP measurement and cached for future use. If signal analyzer or |
| | measurement parameters change, noise floors are remeasured. |
| | |
| | **Supported Devices**: PXIe-5663/5665/5668, PXIe-5830/5831/5832/5842/5860 |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpNoiseCompensationEnabled):
Specifies whether to enable compensation of the channel powers for the inherent noise floor of the signal analyzer.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_NOISE_COMPENSATION_ENABLED.value
)
attr_val = enums.AcpNoiseCompensationEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_noise_compensation_enabled(self, selector_string, value):
r"""Sets whether to enable compensation of the channel powers for the inherent noise floor of the signal analyzer.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | Disables compensation of the channel powers for the noise floor of the signal analyzer. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | Enables compensation of the channel powers for the noise floor of the signal analyzer. The noise floor of the signal |
| | analyzer is measured for the RF path used by the ACP measurement and cached for future use. If signal analyzer or |
| | measurement parameters change, noise floors are remeasured. |
| | |
| | **Supported Devices**: PXIe-5663/5665/5668, PXIe-5830/5831/5832/5842/5860 |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpNoiseCompensationEnabled, int):
Specifies whether to enable compensation of the channel powers for the inherent noise floor of the signal analyzer.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpNoiseCompensationEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_NOISE_COMPENSATION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_averaging_enabled(self, selector_string):
r"""Gets whether to enable averaging for the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The measurement is performed on a single acquisition. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The ACP measurement uses the value of the ACP Averaging Count attribute as the number of acquisitions over which the |
| | ACP measurement is averaged. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpAveragingEnabled):
Specifies whether to enable averaging for the ACP measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_AVERAGING_ENABLED.value
)
attr_val = enums.AcpAveragingEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_averaging_enabled(self, selector_string, value):
r"""Sets whether to enable averaging for the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The measurement is performed on a single acquisition. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The ACP measurement uses the value of the ACP Averaging Count attribute as the number of acquisitions over which the |
| | ACP measurement is averaged. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpAveragingEnabled, int):
Specifies whether to enable averaging for the ACP measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpAveragingEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_AVERAGING_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_averaging_count(self, selector_string):
r"""Gets the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_AVERAGING_ENABLED` to **True**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_AVERAGING_ENABLED` to **True**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_AVERAGING_COUNT.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_averaging_count(self, selector_string, value):
r"""Sets the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_AVERAGING_ENABLED` to **True**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_AVERAGING_ENABLED` to **True**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_AVERAGING_COUNT.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_averaging_type(self, selector_string):
r"""Gets the averaging type for averaging the spectrum of multiple acquisitions. The averaged spectrum is used for ACP
measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **RMS**.
+--------------+-------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+=============================================================================================================+
| RMS (0) | The power spectrum is linearly averaged. RMS averaging reduces signal fluctuations but not the noise floor. |
+--------------+-------------------------------------------------------------------------------------------------------------+
| Log (1) | The power spectrum is averaged in a logarithmic scale. |
+--------------+-------------------------------------------------------------------------------------------------------------+
| Scalar (2) | The square root of the power spectrum is averaged. |
+--------------+-------------------------------------------------------------------------------------------------------------+
| Max (3) | The peak power in the spectrum at each frequency bin is retained from one acquisition to the next. |
+--------------+-------------------------------------------------------------------------------------------------------------+
| Min (4) | The lowest power in the spectrum at each frequency bin is retained from one acquisition to the next. |
+--------------+-------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpAveragingType):
Specifies the averaging type for averaging the spectrum of multiple acquisitions. The averaged spectrum is used for ACP
measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_AVERAGING_TYPE.value
)
attr_val = enums.AcpAveragingType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_averaging_type(self, selector_string, value):
r"""Sets the averaging type for averaging the spectrum of multiple acquisitions. The averaged spectrum is used for ACP
measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **RMS**.
+--------------+-------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+=============================================================================================================+
| RMS (0) | The power spectrum is linearly averaged. RMS averaging reduces signal fluctuations but not the noise floor. |
+--------------+-------------------------------------------------------------------------------------------------------------+
| Log (1) | The power spectrum is averaged in a logarithmic scale. |
+--------------+-------------------------------------------------------------------------------------------------------------+
| Scalar (2) | The square root of the power spectrum is averaged. |
+--------------+-------------------------------------------------------------------------------------------------------------+
| Max (3) | The peak power in the spectrum at each frequency bin is retained from one acquisition to the next. |
+--------------+-------------------------------------------------------------------------------------------------------------+
| Min (4) | The lowest power in the spectrum at each frequency bin is retained from one acquisition to the next. |
+--------------+-------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpAveragingType, int):
Specifies the averaging type for averaging the spectrum of multiple acquisitions. The averaged spectrum is used for ACP
measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpAveragingType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_AVERAGING_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fft_overlap_mode(self, selector_string):
r"""Gets how overlapping is applied when computing the FFT of the acquired samples.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Disabled**.
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==========================================================================================================================+
| Disabled (0) | Indicates that overlapping is not applied to the acquired samples. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Automatic (1) | Indicates that the RFmx driver automatically chooses optimal values of the ACP FFT Overlap attribute based on the |
| | measurement configuration. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpFftOverlapMode):
Specifies how overlapping is applied when computing the FFT of the acquired samples.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_FFT_OVERLAP_MODE.value
)
attr_val = enums.AcpFftOverlapMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_fft_overlap_mode(self, selector_string, value):
r"""Sets how overlapping is applied when computing the FFT of the acquired samples.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Disabled**.
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==========================================================================================================================+
| Disabled (0) | Indicates that overlapping is not applied to the acquired samples. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Automatic (1) | Indicates that the RFmx driver automatically chooses optimal values of the ACP FFT Overlap attribute based on the |
| | measurement configuration. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpFftOverlapMode, int):
Specifies how overlapping is applied when computing the FFT of the acquired samples.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpFftOverlapMode else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_FFT_OVERLAP_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_fft_overlap(self, selector_string):
r"""Gets the number of samples to overlap between consecutive chunks while performing FFT.
This value is expressed as a percentage of the Sequential FFT Size when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute to **Sequential FFT**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the number of samples to overlap between consecutive chunks while performing FFT.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ACP_FFT_OVERLAP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_if_output_power_offset_auto(self, selector_string):
r"""Gets whether the measurement computes an IF output power level offset for the offset channels to improve the
dynamic range of the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
This attribute is used only if you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute to **Dynamic Range**. The default value
is **True**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The measurement sets the IF output power level offset using the values of the ACP Near IF Output Power Offset and ACP |
| | Far IF Output Power Offset attributes. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement automatically computes an IF output power level offset for the offset channels. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpIFOutputPowerOffsetAuto):
Specifies whether the measurement computes an IF output power level offset for the offset channels to improve the
dynamic range of the ACP measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_IF_OUTPUT_POWER_OFFSET_AUTO.value,
)
attr_val = enums.AcpIFOutputPowerOffsetAuto(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_if_output_power_offset_auto(self, selector_string, value):
r"""Sets whether the measurement computes an IF output power level offset for the offset channels to improve the
dynamic range of the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
This attribute is used only if you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute to **Dynamic Range**. The default value
is **True**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The measurement sets the IF output power level offset using the values of the ACP Near IF Output Power Offset and ACP |
| | Far IF Output Power Offset attributes. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement automatically computes an IF output power level offset for the offset channels. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpIFOutputPowerOffsetAuto, int):
Specifies whether the measurement computes an IF output power level offset for the offset channels to improve the
dynamic range of the ACP measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpIFOutputPowerOffsetAuto else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_IF_OUTPUT_POWER_OFFSET_AUTO.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_near_if_output_power_offset(self, selector_string):
r"""Gets the power offset to use to adjust the IF output power level for offset channels near the carrier channel.
Adjusting the IF output power level improves the dynamic range.
This value is expressed in dB.
This attribute is used only if you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute to **Dynamic Range** and set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_IF_OUTPUT_POWER_OFFSET_AUTO` attribute to **False**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the power offset to use to adjust the IF output power level for offset channels near the carrier channel.
Adjusting the IF output power level improves the dynamic range.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string,
attributes.AttributeID.ACP_NEAR_IF_OUTPUT_POWER_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_near_if_output_power_offset(self, selector_string, value):
r"""Sets the power offset to use to adjust the IF output power level for offset channels near the carrier channel.
Adjusting the IF output power level improves the dynamic range.
This value is expressed in dB.
This attribute is used only if you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute to **Dynamic Range** and set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_IF_OUTPUT_POWER_OFFSET_AUTO` attribute to **False**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the power offset to use to adjust the IF output power level for offset channels near the carrier channel.
Adjusting the IF output power level improves the dynamic range.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.ACP_NEAR_IF_OUTPUT_POWER_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_far_if_output_power_offset(self, selector_string):
r"""Gets the power offset to use to adjust the IF output power level for offset channels that are far from the carrier
channel. Adjusting the IF output power level improves the dynamic range.
This value is expressed in dB.
This attribute is used only if you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute to **Dynamic Range** and set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_IF_OUTPUT_POWER_OFFSET_AUTO` attribute to **False**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 20.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the power offset to use to adjust the IF output power level for offset channels that are far from the carrier
channel. Adjusting the IF output power level improves the dynamic range.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ACP_FAR_IF_OUTPUT_POWER_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_far_if_output_power_offset(self, selector_string, value):
r"""Sets the power offset to use to adjust the IF output power level for offset channels that are far from the carrier
channel. Adjusting the IF output power level improves the dynamic range.
This value is expressed in dB.
This attribute is used only if you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute to **Dynamic Range** and set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_IF_OUTPUT_POWER_OFFSET_AUTO` attribute to **False**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 20.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the power offset to use to adjust the IF output power level for offset channels that are far from the carrier
channel. Adjusting the IF output power level improves the dynamic range.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.ACP_FAR_IF_OUTPUT_POWER_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_sequential_fft_size(self, selector_string):
r"""Gets the number of bins to use for FFT computation when the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute is set to **Sequential FFT**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 512.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of bins to use for FFT computation when the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute is set to **Sequential FFT**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_SEQUENTIAL_FFT_SIZE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_sequential_fft_size(self, selector_string, value):
r"""Sets the number of bins to use for FFT computation when the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute is set to **Sequential FFT**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 512.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of bins to use for FFT computation when the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.ACP_MEASUREMENT_METHOD` attribute is set to **Sequential FFT**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_SEQUENTIAL_FFT_SIZE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_amplitude_correction_type(self, selector_string):
r"""Gets whether the amplitude of the frequency bins, used in measurements, is corrected for external attenuation at
the RF center frequency, or at the individual frequency bins. Use the `RFmxInstr Configure External Attenuation
<rfmxinstrvi.chm/RFmxInstr_Configure_External_Attenuation_Table.html>`_ method to configure the external attenuation
table.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **RF Center Frequency**.
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+============================+==========================================================================================================================+
| RF Center Frequency (0) | All the frequency bins in the spectrum are compensated with a single external attenuation value that corresponds to the |
| | RF center frequency. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Spectrum Frequency Bin (1) | An individual frequency bin in the spectrum is compensated with the external attenuation value corresponding to that |
| | frequency. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AcpAmplitudeCorrectionType):
Specifies whether the amplitude of the frequency bins, used in measurements, is corrected for external attenuation at
the RF center frequency, or at the individual frequency bins. Use the `RFmxInstr Configure External Attenuation
<rfmxinstrvi.chm/RFmxInstr_Configure_External_Attenuation_Table.html>`_ method to configure the external attenuation
table.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_AMPLITUDE_CORRECTION_TYPE.value
)
attr_val = enums.AcpAmplitudeCorrectionType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_amplitude_correction_type(self, selector_string, value):
r"""Sets whether the amplitude of the frequency bins, used in measurements, is corrected for external attenuation at
the RF center frequency, or at the individual frequency bins. Use the `RFmxInstr Configure External Attenuation
<rfmxinstrvi.chm/RFmxInstr_Configure_External_Attenuation_Table.html>`_ method to configure the external attenuation
table.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **RF Center Frequency**.
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+============================+==========================================================================================================================+
| RF Center Frequency (0) | All the frequency bins in the spectrum are compensated with a single external attenuation value that corresponds to the |
| | RF center frequency. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Spectrum Frequency Bin (1) | An individual frequency bin in the spectrum is compensated with the external attenuation value corresponding to that |
| | frequency. |
+----------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AcpAmplitudeCorrectionType, int):
Specifies whether the amplitude of the frequency bins, used in measurements, is corrected for external attenuation at
the RF center frequency, or at the individual frequency bins. Use the `RFmxInstr Configure External Attenuation
<rfmxinstrvi.chm/RFmxInstr_Configure_External_Attenuation_Table.html>`_ method to configure the external attenuation
table.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
value = value.value if type(value) is enums.AcpAmplitudeCorrectionType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_AMPLITUDE_CORRECTION_TYPE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_all_traces_enabled(self, selector_string):
r"""Gets whether to enable the traces to be stored and retrieved after performing the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (bool):
Specifies whether to enable the traces to be stored and retrieved after performing the ACP measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_ALL_TRACES_ENABLED.value
)
attr_val = bool(attr_val)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_all_traces_enabled(self, selector_string, value):
r"""Sets whether to enable the traces to be stored and retrieved after performing the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
value (bool):
Specifies whether to enable the traces to be stored and retrieved after performing the ACP measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_ALL_TRACES_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_number_of_analysis_threads(self, selector_string):
r"""Gets the maximum number of threads used for parallelism for the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The number of threads can range from 1 to the number of physical cores. The number of threads you set may not
be used in calculations. The actual number of threads used depends on the problem size, system resources, data
availability, and other considerations. The default value is 1.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the maximum number of threads used for parallelism for the ACP measurement.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ACP_NUMBER_OF_ANALYSIS_THREADS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_analysis_threads(self, selector_string, value):
r"""Sets the maximum number of threads used for parallelism for the ACP measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The number of threads can range from 1 to the number of physical cores. The number of threads you set may not
be used in calculations. The actual number of threads used depends on the problem size, system resources, data
availability, and other considerations. The default value is 1.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the maximum number of threads used for parallelism for the ACP measurement.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ACP_NUMBER_OF_ANALYSIS_THREADS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code