Source code for nirfmxwcdma.modacc_configuration

"""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 configure_synchronization_mode_and_interval( self, selector_string, synchronization_mode, measurement_offset, measurement_length ): r"""Configures the synchronization mode, measurement offset, and measurement length of the ModAcc measurement. Args: selector_string (string): Pass an empty string. The signal name that is passed when creating the signal configuration is used. synchronization_mode (enums.ModAccSynchronizationMode, int): This parameter specifies whether the measurement is performed from the frame, slot, or symbol boundary. 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 Measurement | | | Length parameter starting at 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 Measurement | | | Length parameter starting at 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 Measurement | | | Length parameter starting at Measurement Offset slots from the symbol boundary. | +---------------+--------------------------------------------------------------------------------------------------------------------------+ | Marker (3) | The measurement is performed over the number of slots expressed by the Measurement Length parameter starting at | | | 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. | +---------------+--------------------------------------------------------------------------------------------------------------------------+ measurement_offset (int): This parameter specifies the measurement offset to skip from the synchronization boundary. This value is expressed in slots. The synchronization boundary is specified by the **Synchronization Mode** parameter. The default value is 0. Valid values are [0, (15 - ModAcc Measurement Length)]. The sum of the ModAcc measurement offset and ModAcc measurement length must be less than or equal to 15. measurement_length (int): This parameter specifies the duration for the modulation accuracy measurement. This value is expressed in slots. The default value is 1. Valid values are [1,(15 - ModAcc Measurement Offset)]. The sum of the ModAcc measurement offset and ModAcc measurement length must be less than or equal to 15. 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() _helper.validate_not_none(selector_string, "selector_string") synchronization_mode = ( synchronization_mode.value if type(synchronization_mode) is enums.ModAccSynchronizationMode else synchronization_mode ) updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.modacc_configure_synchronization_mode_and_interval( updated_selector_string, synchronization_mode, measurement_offset, measurement_length, ) finally: self._session_function_lock.exit_read_lock() return error_code
[docs] @_raise_if_disposed def configure_reference_waveform(self, selector_string, x0, dx, reference_waveform): r"""Configures the reference waveform such that it corresponds to the transmitted signal for the ModAcc measurement. This reference waveform helps achieve faster ModAcc measurements. This method is used only when you set the :py:attr:`~nirfmxwcdma.attributes.AttributeID.MODACC_SYNCHRONIZATION_MODE` attribute to **Marker**. Args: selector_string (string): Pass an empty string. The signal name that is passed when creating the signal configuration is used. x0 (float): This parameter specifies the start time. This value is expressed in seconds. dx (float): This parameter specifies the sample duration. This value is expressed in seconds. reference_waveform (numpy.complex64): This parameter specifies an array of the normalized ideal complex baseband samples, corresponding to the acquired signal. This value is expressed in volts. 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() _helper.validate_not_none(selector_string, "selector_string") updated_selector_string = _helper.validate_and_update_selector_string( selector_string, self._signal_obj ) error_code = self._interpreter.modacc_configure_reference_waveform( updated_selector_string, x0, dx, reference_waveform ) finally: self._session_function_lock.exit_read_lock() return error_code