"""Provides methods to configure the ModAcc measurement."""
import functools
import nirfmxcdma2k.attributes as attributes
import nirfmxcdma2k.enums as enums
import nirfmxcdma2k.errors as errors
import nirfmxcdma2k.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 Cdma2k signal configuration")
return f(*xs, **kws)
return aux
[docs]
class ModAccConfiguration(object):
"""Provides methods to configure the ModAcc measurement."""
def __init__(self, signal_obj):
"""Provides methods to configure the ModAcc 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 modulation accuracy (ModAcc) 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 modulation accuracy (ModAcc) 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.MODACC_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 modulation accuracy (ModAcc) 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 modulation accuracy (ModAcc) 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.MODACC_MEASUREMENT_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_synchronization_mode(self, selector_string):
r"""Gets whether the measurement is performed from the frame, slot, or symbol boundary.
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 **Slot**.
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==========================================================================================================================+
| Frame (0) | The frame boundary is detected, and the measurement is performed over the ModAcc Meas Length attribute starting at the |
| | ModAcc Meas Offset attribute from the frame boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Slot (1) | The slot boundary is detected, and the measurement is performed over the ModAcc Meas Length attribute starting at the |
| | ModAcc Meas Offset attribute from the slot boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Arbitrary (2) | The symbol boundary is detected, and the measurement is performed over the ModAcc Meas Length attribute starting at the |
| | ModAcc Meas Offset attribute from the slot boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccSynchronizationMode):
Specifies whether the measurement is performed from the frame, slot, or symbol boundary.
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.MODACC_SYNCHRONIZATION_MODE.value
)
attr_val = enums.ModAccSynchronizationMode(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_synchronization_mode(self, selector_string, value):
r"""Sets whether the measurement is performed from the frame, slot, or symbol boundary.
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 **Slot**.
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==========================================================================================================================+
| Frame (0) | The frame boundary is detected, and the measurement is performed over the ModAcc Meas Length attribute starting at the |
| | ModAcc Meas Offset attribute from the frame boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Slot (1) | The slot boundary is detected, and the measurement is performed over the ModAcc Meas Length attribute starting at the |
| | ModAcc Meas Offset attribute from the slot boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Arbitrary (2) | The symbol boundary is detected, and the measurement is performed over the ModAcc Meas Length attribute starting at the |
| | ModAcc Meas Offset attribute from the slot boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccSynchronizationMode, int):
Specifies whether the measurement is performed from the frame, slot, or symbol boundary.
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.ModAccSynchronizationMode else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_offset(self, selector_string):
r"""Gets the measurement offset to skip from the synchronization boundary. The synchronization boundary is specified
by the :py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE` attribute. This value is expressed
in slots.
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. The valid values are 1 to 16, inclusive. The sum of the ModAcc measurement offset and
the ModAcc measurement length must be less than or equal to 16.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the measurement offset to skip from the synchronization boundary. The synchronization boundary is specified
by the :py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE` attribute. This value is expressed
in slots.
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.MODACC_MEASUREMENT_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_offset(self, selector_string, value):
r"""Sets the measurement offset to skip from the synchronization boundary. The synchronization boundary is specified
by the :py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE` attribute. This value is expressed
in slots.
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. The valid values are 1 to 16, inclusive. The sum of the ModAcc measurement offset and
the ModAcc measurement length must be less than or equal to 16.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the measurement offset to skip from the synchronization boundary. The synchronization boundary is specified
by the :py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE` attribute. This value is expressed
in slots.
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.MODACC_MEASUREMENT_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_length(self, selector_string):
r"""Gets the duration of the modulation accuracy (ModAcc) measurement. This value is expressed in slots.
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 1. The valid values are 1 to 16, inclusive. The sum of the ModAcc measurement offset and
the ModAcc measurement length must be less than or equal to 16.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the duration of the modulation accuracy (ModAcc) measurement. This value is expressed in slots.
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.MODACC_MEASUREMENT_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_length(self, selector_string, value):
r"""Sets the duration of the modulation accuracy (ModAcc) measurement. This value is expressed in slots.
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 1. The valid values are 1 to 16, inclusive. The sum of the ModAcc measurement offset and
the ModAcc measurement length must be less than or equal to 16.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the duration of the modulation accuracy (ModAcc) measurement. This value is expressed in slots.
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.MODACC_MEASUREMENT_LENGTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_spectrum_inverted(self, selector_string):
r"""Gets whether the spectrum of the signal is inverted.
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 measured spectrum is not inverted. |
+--------------+----------------------------------------+
| True (1) | The measured spectrum is inverted. |
+--------------+----------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccSpectrumInverted):
Specifies whether the spectrum of the signal is inverted.
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.MODACC_SPECTRUM_INVERTED.value
)
attr_val = enums.ModAccSpectrumInverted(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_spectrum_inverted(self, selector_string, value):
r"""Sets whether the spectrum of the signal is inverted.
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 measured spectrum is not inverted. |
+--------------+----------------------------------------+
| True (1) | The measured spectrum is inverted. |
+--------------+----------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccSpectrumInverted, int):
Specifies whether the spectrum of the signal is inverted.
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.ModAccSpectrumInverted else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_SPECTRUM_INVERTED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_iq_offset_removal_enabled(self, selector_string):
r"""Gets whether to remove the I/Q offset before an EVM 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) | I/Q offset is not removed before the EVM measurement. |
+--------------+-------------------------------------------------------+
| True (1) | I/Q offset is removed before the EVM measurement. |
+--------------+-------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccIQOffsetRemovalEnabled):
Specifies whether to remove the I/Q offset before an EVM 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.MODACC_IQ_OFFSET_REMOVAL_ENABLED.value,
)
attr_val = enums.ModAccIQOffsetRemovalEnabled(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_iq_offset_removal_enabled(self, selector_string, value):
r"""Sets whether to remove the I/Q offset before an EVM 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) | I/Q offset is not removed before the EVM measurement. |
+--------------+-------------------------------------------------------+
| True (1) | I/Q offset is removed before the EVM measurement. |
+--------------+-------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccIQOffsetRemovalEnabled, int):
Specifies whether to remove the I/Q offset before an EVM 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.ModAccIQOffsetRemovalEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_IQ_OFFSET_REMOVAL_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_iq_gain_imbalance_removal_enabled(self, selector_string):
r"""Gets whether to remove the I/Q gain imbalance before an EVM 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) | I/Q gain imbalance is not removed before the EVM measurement. |
+--------------+---------------------------------------------------------------+
| True (1) | I/Q gain imbalance is removed before the EVM measurement. |
+--------------+---------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccIQGainImbalanceRemovalEnabled):
Specifies whether to remove the I/Q gain imbalance before an EVM 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.MODACC_IQ_GAIN_IMBALANCE_REMOVAL_ENABLED.value,
)
attr_val = enums.ModAccIQGainImbalanceRemovalEnabled(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_iq_gain_imbalance_removal_enabled(self, selector_string, value):
r"""Sets whether to remove the I/Q gain imbalance before an EVM 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) | I/Q gain imbalance is not removed before the EVM measurement. |
+--------------+---------------------------------------------------------------+
| True (1) | I/Q gain imbalance is removed before the EVM measurement. |
+--------------+---------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccIQGainImbalanceRemovalEnabled, int):
Specifies whether to remove the I/Q gain imbalance before an EVM 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.ModAccIQGainImbalanceRemovalEnabled else value
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_IQ_GAIN_IMBALANCE_REMOVAL_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_iq_quadrature_error_removal_enabled(self, selector_string):
r"""Gets whether to remove the I/Q quadrature error before an EVM 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) | I/Q quadrature error is not removed before the EVM measurement. |
+--------------+-----------------------------------------------------------------+
| True (1) | I/Q quadrature error is removed before the EVM measurement. |
+--------------+-----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccIQQuadratureErrorRemovalEnabled):
Specifies whether to remove the I/Q quadrature error before an EVM 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.MODACC_IQ_QUADRATURE_ERROR_REMOVAL_ENABLED.value,
)
attr_val = enums.ModAccIQQuadratureErrorRemovalEnabled(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_iq_quadrature_error_removal_enabled(self, selector_string, value):
r"""Sets whether to remove the I/Q quadrature error before an EVM 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) | I/Q quadrature error is not removed before the EVM measurement. |
+--------------+-----------------------------------------------------------------+
| True (1) | I/Q quadrature error is removed before the EVM measurement. |
+--------------+-----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccIQQuadratureErrorRemovalEnabled, int):
Specifies whether to remove the I/Q quadrature error before an EVM 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.ModAccIQQuadratureErrorRemovalEnabled else value
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_IQ_QUADRATURE_ERROR_REMOVAL_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_receive_filter_enabled(self, selector_string):
r"""Gets whether to enable the received filter for the ModAcc measurement. For RC1/2, this attribute refers to the
band-limiting filter specified in the Chapter 6.4.2.1 of *3GPP2 C.S0011-E*.
For RC3/4, this attribute refers to the complementary filter specified in the Chapter 6.4.2.2 of *3GPP2
C.S0011-E*.
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) | Disables received filtering for the ModAcc measurement. |
+--------------+---------------------------------------------------------+
| True (1) | Enables received filtering for the ModAcc measurement. |
+--------------+---------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccReceiveFilterEnabled):
Specifies whether to enable the received filter for the ModAcc measurement. For RC1/2, this attribute refers to the
band-limiting filter specified in the Chapter 6.4.2.1 of *3GPP2 C.S0011-E*.
For RC3/4, this attribute refers to the complementary filter specified in the Chapter 6.4.2.2 of *3GPP2
C.S0011-E*.
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.MODACC_RECEIVE_FILTER_ENABLED.value
)
attr_val = enums.ModAccReceiveFilterEnabled(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_receive_filter_enabled(self, selector_string, value):
r"""Sets whether to enable the received filter for the ModAcc measurement. For RC1/2, this attribute refers to the
band-limiting filter specified in the Chapter 6.4.2.1 of *3GPP2 C.S0011-E*.
For RC3/4, this attribute refers to the complementary filter specified in the Chapter 6.4.2.2 of *3GPP2
C.S0011-E*.
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) | Disables received filtering for the ModAcc measurement. |
+--------------+---------------------------------------------------------+
| True (1) | Enables received filtering for the ModAcc measurement. |
+--------------+---------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccReceiveFilterEnabled, int):
Specifies whether to enable the received filter for the ModAcc measurement. For RC1/2, this attribute refers to the
band-limiting filter specified in the Chapter 6.4.2.1 of *3GPP2 C.S0011-E*.
For RC3/4, this attribute refers to the complementary filter specified in the Chapter 6.4.2.2 of *3GPP2
C.S0011-E*.
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.ModAccReceiveFilterEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RECEIVE_FILTER_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_multi_carrier_filter_enabled(self, selector_string):
r"""Gets whether to enable the multi carrier filter which can be used to improve ModAcc measurement quality in
presence of neighboring carriers.
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 multi carrier filter for ModAcc measurement. |
+--------------+-------------------------------------------------------+
| True (1) | Enables multi carrier filter for ModAcc measurement. |
+--------------+-------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccMultiCarrierFilterEnabled):
Specifies whether to enable the multi carrier filter which can be used to improve ModAcc measurement quality in
presence of neighboring carriers.
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.MODACC_MULTI_CARRIER_FILTER_ENABLED.value,
)
attr_val = enums.ModAccMultiCarrierFilterEnabled(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_multi_carrier_filter_enabled(self, selector_string, value):
r"""Sets whether to enable the multi carrier filter which can be used to improve ModAcc measurement quality in
presence of neighboring carriers.
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 multi carrier filter for ModAcc measurement. |
+--------------+-------------------------------------------------------+
| True (1) | Enables multi carrier filter for ModAcc measurement. |
+--------------+-------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccMultiCarrierFilterEnabled, int):
Specifies whether to enable the multi carrier filter which can be used to improve ModAcc measurement quality in
presence of neighboring carriers.
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.ModAccMultiCarrierFilterEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_MULTI_CARRIER_FILTER_ENABLED.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 modulation accuracy (ModAcc)
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 modulation accuracy (ModAcc)
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.MODACC_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 modulation accuracy (ModAcc)
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 modulation accuracy (ModAcc)
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.MODACC_ALL_TRACES_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code