"""Provides methods to configure the ModAcc 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 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 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 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 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 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 number of slots expressed by the ModAcc |
| | Measurement Length attribute starting at ModAcc Measurement offset slots from the frame boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Slot (1) | The slot boundary is detected and the measurement is performed over the number of slots expressed by the ModAcc |
| | Measurement Length attribute starting at ModAcc Measurement Offset slots from the slot boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Arbitrary (2) | The symbol boundary is detected and the measurement is performed over the number of slots expressed by the ModAcc |
| | Measurement Length attribute starting at ModAcc Measurement Offset slots from the symbol boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Marker (3) | The measurement is performed over the number of slots expressed by the ModAcc Measurement Length attribute starting at |
| | ModAcc Measurement Offset slots from the trigger. This is the fastest way to do a ModAcc measurement. This mode |
| | requires the Trigger Type attribute to be set to **Digital** and the trigger must occur at the start of the frame. For |
| | more information about Marker mode, refer to Marker Mode. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
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 number of slots expressed by the ModAcc |
| | Measurement Length attribute starting at ModAcc Measurement offset slots from the frame boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Slot (1) | The slot boundary is detected and the measurement is performed over the number of slots expressed by the ModAcc |
| | Measurement Length attribute starting at ModAcc Measurement Offset slots from the slot boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Arbitrary (2) | The symbol boundary is detected and the measurement is performed over the number of slots expressed by the ModAcc |
| | Measurement Length attribute starting at ModAcc Measurement Offset slots from the symbol boundary. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Marker (3) | The measurement is performed over the number of slots expressed by the ModAcc Measurement Length attribute starting at |
| | ModAcc Measurement Offset slots from the trigger. This is the fastest way to do a ModAcc measurement. This mode |
| | requires the Trigger Type attribute to be set to **Digital** and the trigger must occur at the start of the frame. For |
| | more information about Marker mode, refer to Marker Mode. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
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. This value is expressed in slots. The
synchronization boundary is specified by the :py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE`
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 0. Valid values are [0, (15 -
:py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_MEASUREMENT_LENGTH` )]. The sum of the ModAcc measurement offset
and ModAcc measurement length must be less than or equal to 15.
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. This value is expressed in slots. The
synchronization boundary is specified by the :py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE`
attribute.
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. This value is expressed in slots. The
synchronization boundary is specified by the :py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE`
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 0. Valid values are [0, (15 -
:py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_MEASUREMENT_LENGTH` )]. The sum of the ModAcc measurement offset
and ModAcc measurement length must be less than or equal to 15.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the measurement offset to skip from the synchronization boundary. This value is expressed in slots. The
synchronization boundary is specified by the :py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE`
attribute.
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 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. Valid values are [1, (15 -
:py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_MEASUREMENT_OFFSET`)]. The sum of the ModAcc measurement offset
and ModAcc measurement length must be less than or equal to 15.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the duration of the 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_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 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. Valid values are [1, (15 -
:py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_MEASUREMENT_OFFSET`)]. The sum of the ModAcc measurement offset
and ModAcc measurement length must be less than or equal to 15.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the duration of the 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_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 spectrum is not inverted. |
+--------------+-------------------------------+
| True (1) | The 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 spectrum is not inverted. |
+--------------+-------------------------------+
| True (1) | The 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 the 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**.
+--------------+--------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================+
| False (0) | The I/Q offset is not removed before the ModAcc measurement. |
+--------------+--------------------------------------------------------------+
| True (1) | The I/Q offset is removed before the ModAcc 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 the 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_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 the 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**.
+--------------+--------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================+
| False (0) | The I/Q offset is not removed before the ModAcc measurement. |
+--------------+--------------------------------------------------------------+
| True (1) | The I/Q offset is removed before the ModAcc measurement. |
+--------------+--------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccIQOffsetRemovalEnabled, int):
Specifies whether to remove the I/Q offset before the 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
)
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 I/Q gain imbalance before the ModAcc Measurement. In case of multi-carrier measurements,
this attribute is valid only when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE`
attribute is set to **LO per Carrier**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE` topic for information about the
string syntax for named signals.
The default value is **False**.
+--------------+----------------------------------------------------------------------+
| Name (Value) | Description |
+==============+======================================================================+
| False (0) | The I/Q gain imbalance is not removed before the ModAcc measurement. |
+--------------+----------------------------------------------------------------------+
| True (1) | The I/Q gain imbalance is removed before the ModAcc measurement. |
+--------------+----------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccIQGainImbalanceRemovalEnabled):
Specifies whether to remove I/Q gain imbalance before the ModAcc Measurement. In case of multi-carrier measurements,
this attribute is valid only when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE`
attribute is set to **LO per 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.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 I/Q gain imbalance before the ModAcc Measurement. In case of multi-carrier measurements,
this attribute is valid only when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE`
attribute is set to **LO per Carrier**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the :py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE` topic for information about the
string syntax for named signals.
The default value is **False**.
+--------------+----------------------------------------------------------------------+
| Name (Value) | Description |
+==============+======================================================================+
| False (0) | The I/Q gain imbalance is not removed before the ModAcc measurement. |
+--------------+----------------------------------------------------------------------+
| True (1) | The I/Q gain imbalance is removed before the ModAcc measurement. |
+--------------+----------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccIQGainImbalanceRemovalEnabled, int):
Specifies whether to remove I/Q gain imbalance before the ModAcc Measurement. In case of multi-carrier measurements,
this attribute is valid only when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE`
attribute is set to **LO per 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
)
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 the ModAcc measurement. In case of multi-carrier
measurements, this attribute is valid only when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE` attribute is set to **LO per Carrier**.
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 I/Q quadrature error is not removed before the ModAcc measurement. |
+--------------+------------------------------------------------------------------------+
| True (1) | The I/Q quadrature error is removed before the ModAcc 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 the ModAcc measurement. In case of multi-carrier
measurements, this attribute is valid only when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE` attribute is set to **LO per 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.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 the ModAcc measurement. In case of multi-carrier
measurements, this attribute is valid only when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE` attribute is set to **LO per Carrier**.
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 I/Q quadrature error is not removed before the ModAcc measurement. |
+--------------+------------------------------------------------------------------------+
| True (1) | The I/Q quadrature error is removed before the ModAcc measurement. |
+--------------+------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccIQQuadratureErrorRemovalEnabled, int):
Specifies whether to remove the I/Q quadrature error before the ModAcc measurement. In case of multi-carrier
measurements, this attribute is valid only when you set the
:py:attr:`~nirfmxwcdma.attributes.AttributeID.TRANSMITTER_ARCHITECTURE` attribute is set to **LO per 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
)
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_transient_removal_enabled(self, selector_string):
r"""Gets whether the measurement excludes 25 microseconds from the start and end of each slot while computing the RMS
EVM, peak EVM, RMS magnitude error and RMS phase error results.
Transients are expected to be present at the slot boundaries, where the mean power of the received signal can
change.
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 entire measurement interval is used to compute the RMS EVM, peak EVM, RMS magnitude error, and RMS phase error |
| | results. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement excludes 25 microseconds from the start and end of each slot while computing the RMS EVM, peak EVM, RMS |
| | magnitude error, and RMS phase error results. The ModAcc Sync Mode attribute must be set to **Frame**, **Slot**, or |
| | **Marker**. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccTransientRemovalEnabled):
Specifies whether the measurement excludes 25 microseconds from the start and end of each slot while computing the RMS
EVM, peak EVM, RMS magnitude error and RMS phase error results.
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_TRANSIENT_REMOVAL_ENABLED.value,
)
attr_val = enums.ModAccTransientRemovalEnabled(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_transient_removal_enabled(self, selector_string, value):
r"""Sets whether the measurement excludes 25 microseconds from the start and end of each slot while computing the RMS
EVM, peak EVM, RMS magnitude error and RMS phase error results.
Transients are expected to be present at the slot boundaries, where the mean power of the received signal can
change.
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 entire measurement interval is used to compute the RMS EVM, peak EVM, RMS magnitude error, and RMS phase error |
| | results. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement excludes 25 microseconds from the start and end of each slot while computing the RMS EVM, peak EVM, RMS |
| | magnitude error, and RMS phase error results. The ModAcc Sync Mode attribute must be set to **Frame**, **Slot**, or |
| | **Marker**. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccTransientRemovalEnabled, int):
Specifies whether the measurement excludes 25 microseconds from the start and end of each slot while computing the RMS
EVM, peak EVM, RMS magnitude error and RMS phase error results.
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.ModAccTransientRemovalEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_TRANSIENT_REMOVAL_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_rrc_filter_enabled(self, selector_string):
r"""Gets whether to enable the RRC filter. Use this attribute to disable the filter if the received signal is already
RRC-filtered.
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 the RRC filter in the measurement. |
+--------------+---------------------------------------------+
| True (1) | Enables the RRC filter in the measurement. |
+--------------+---------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccRrcFilterEnabled):
Specifies whether to enable the RRC filter. Use this attribute to disable the filter if the received signal is already
RRC-filtered.
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_RRC_FILTER_ENABLED.value
)
attr_val = enums.ModAccRrcFilterEnabled(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_rrc_filter_enabled(self, selector_string, value):
r"""Sets whether to enable the RRC filter. Use this attribute to disable the filter if the received signal is already
RRC-filtered.
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 the RRC filter in the measurement. |
+--------------+---------------------------------------------+
| True (1) | Enables the RRC filter in the measurement. |
+--------------+---------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ModAccRrcFilterEnabled, int):
Specifies whether to enable the RRC filter. Use this attribute to disable the filter if the received signal is already
RRC-filtered.
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.ModAccRrcFilterEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RRC_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 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 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 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 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
[docs]
@_raise_if_disposed
def get_downlink_timing_channel_spreading_factor(self, selector_string):
r"""The spreading factor.
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 (int):
The spreading factor.
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_DOWNLINK_TIMING_CHANNEL_SPREADING_FACTOR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_downlink_timing_channel_spreading_factor(self, selector_string, value):
r"""The spreading factor.
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.
value (int):
The spreading factor.
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_DOWNLINK_TIMING_CHANNEL_SPREADING_FACTOR.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_downlink_timing_channel_code(self, selector_string):
r"""The channel code.
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 (int):
The channel code.
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_DOWNLINK_TIMING_CHANNEL_CODE.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_downlink_timing_channel_code(self, selector_string, value):
r"""The channel code.
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.
value (int):
The channel code.
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_DOWNLINK_TIMING_CHANNEL_CODE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code