"""Provides methods to configure the Orfs measurement."""
import functools
import nirfmxgsm.attributes as attributes
import nirfmxgsm.enums as enums
import nirfmxgsm.errors as errors
import nirfmxgsm.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 Gsm signal configuration")
return f(*xs, **kws)
return aux
[docs]
class OrfsConfiguration(object):
"""Provides methods to configure the Orfs measurement."""
def __init__(self, signal_obj):
"""Provides methods to configure the Orfs 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 output radio frequency spectrum (ORFS) measurement.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String 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 output radio frequency spectrum (ORFS) 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.ORFS_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 output radio frequency spectrum (ORFS) measurement.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String 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 output radio frequency spectrum (ORFS) 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.ORFS_MEASUREMENT_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_interval(self, selector_string):
r"""Gets whether the measurement is performed on a single specified timeslot or across multiple timeslots.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default Value is **'Number of Timeslots'**.
+-------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+=========================+==========================================================================================================================+
| Number of Timeslots (0) | The measurement includes all timeslots defined by the Num Timeslots attribute. |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Timeslot at Offset (1) | The measurement is performed only on the timeslot specified by the ORFS Meas Offset attribute. This attribute is |
| | applicable only when you set the Trigger Type attribute to **IQ Power Edge** or **Digital Edge **. |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.OrfsMeasurementInterval):
Specifies whether the measurement is performed on a single specified timeslot or across multiple timeslots.
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.ORFS_MEASUREMENT_INTERVAL.value
)
attr_val = enums.OrfsMeasurementInterval(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_interval(self, selector_string, value):
r"""Sets whether the measurement is performed on a single specified timeslot or across multiple timeslots.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default Value is **'Number of Timeslots'**.
+-------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+=========================+==========================================================================================================================+
| Number of Timeslots (0) | The measurement includes all timeslots defined by the Num Timeslots attribute. |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Timeslot at Offset (1) | The measurement is performed only on the timeslot specified by the ORFS Meas Offset attribute. This attribute is |
| | applicable only when you set the Trigger Type attribute to **IQ Power Edge** or **Digital Edge **. |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.OrfsMeasurementInterval, int):
Specifies whether the measurement is performed on a single specified timeslot or across multiple timeslots.
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.OrfsMeasurementInterval else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ORFS_MEASUREMENT_INTERVAL.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 offset, relative to the trigger, of the timeslot to be measured.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 0. Valid values are [0, (:py:attr:`~nirfmxgsm.attributes.AttributeID.NUMBER_OF_TIMESLOTS`
-1)].
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the offset, relative to the trigger, of the timeslot to be measured.
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.ORFS_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 offset, relative to the trigger, of the timeslot to be measured.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 0. Valid values are [0, (:py:attr:`~nirfmxgsm.attributes.AttributeID.NUMBER_OF_TIMESLOTS`
-1)].
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the offset, relative to the trigger, of the timeslot to be measured.
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.ORFS_MEASUREMENT_OFFSET.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_averaging_enabled(self, selector_string):
r"""Gets whether to enable averaging for the output radio frequency spectrum (ORFS) measurement.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **False**.
+--------------+---------------------------------------------------------+
| Name (Value) | Description |
+==============+=========================================================+
| False (0) | The measurement is performed on a single acquisition. |
+--------------+---------------------------------------------------------+
| True (1) | The measurement is averaged over multiple acquisitions. |
+--------------+---------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.OrfsAveragingEnabled):
Specifies whether to enable averaging for the output radio frequency spectrum (ORFS) 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.ORFS_AVERAGING_ENABLED.value
)
attr_val = enums.OrfsAveragingEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_averaging_enabled(self, selector_string, value):
r"""Sets whether to enable averaging for the output radio frequency spectrum (ORFS) measurement.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **False**.
+--------------+---------------------------------------------------------+
| Name (Value) | Description |
+==============+=========================================================+
| False (0) | The measurement is performed on a single acquisition. |
+--------------+---------------------------------------------------------+
| True (1) | The measurement is averaged over multiple acquisitions. |
+--------------+---------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.OrfsAveragingEnabled, int):
Specifies whether to enable averaging for the output radio frequency spectrum (ORFS) 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.OrfsAveragingEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ORFS_AVERAGING_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_averaging_type(self, selector_string):
r"""Gets the averaging type for averaging multiple spectrum acquisitions. The averaged spectrum is used for the output
radio frequency spectrum (ORFS) measurement.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **Log**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| RMS (0) | The measurement averages the power spectrum linearly. RMS averaging reduces signal fluctuations but not the noise |
| | floor. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Log (1) | The measurement averages the power spectrum in a logarithmic scale. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.OrfsAveragingType):
Specifies the averaging type for averaging multiple spectrum acquisitions. The averaged spectrum is used for the output
radio frequency spectrum (ORFS) 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.ORFS_AVERAGING_TYPE.value
)
attr_val = enums.OrfsAveragingType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_averaging_type(self, selector_string, value):
r"""Sets the averaging type for averaging multiple spectrum acquisitions. The averaged spectrum is used for the output
radio frequency spectrum (ORFS) measurement.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **Log**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| RMS (0) | The measurement averages the power spectrum linearly. RMS averaging reduces signal fluctuations but not the noise |
| | floor. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Log (1) | The measurement averages the power spectrum in a logarithmic scale. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.OrfsAveragingType, int):
Specifies the averaging type for averaging multiple spectrum acquisitions. The averaged spectrum is used for the output
radio frequency spectrum (ORFS) 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.OrfsAveragingType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ORFS_AVERAGING_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_averaging_count(self, selector_string):
r"""Gets the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxgsm.attributes.AttributeID.ORFS_AVERAGING_ENABLED` attribute to **True**.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxgsm.attributes.AttributeID.ORFS_AVERAGING_ENABLED` attribute to **True**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.ORFS_AVERAGING_COUNT.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_averaging_count(self, selector_string, value):
r"""Sets the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxgsm.attributes.AttributeID.ORFS_AVERAGING_ENABLED` attribute to **True**.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of acquisitions used for averaging when you set the
:py:attr:`~nirfmxgsm.attributes.AttributeID.ORFS_AVERAGING_ENABLED` attribute to **True**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ORFS_AVERAGING_COUNT.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_type(self, selector_string):
r"""Gets the type of spectral distortion to be measured.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **Modulation and Switching**.
+------------------------------+-------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============================+=====================================================================================+
| Modulation and Switching (0) | Measures the spectrum on the modulated part and the switching part of the waveform. |
+------------------------------+-------------------------------------------------------------------------------------+
| Modulation (1) | Measures the spectrum on the modulated part of the waveform. |
+------------------------------+-------------------------------------------------------------------------------------+
| Switching (2) | Measures the spectrum on the switching part of the waveform. |
+------------------------------+-------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.OrfsMeasurementType):
Specifies the type of spectral distortion to be measured.
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.ORFS_MEASUREMENT_TYPE.value
)
attr_val = enums.OrfsMeasurementType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_type(self, selector_string, value):
r"""Sets the type of spectral distortion to be measured.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **Modulation and Switching**.
+------------------------------+-------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============================+=====================================================================================+
| Modulation and Switching (0) | Measures the spectrum on the modulated part and the switching part of the waveform. |
+------------------------------+-------------------------------------------------------------------------------------+
| Modulation (1) | Measures the spectrum on the modulated part of the waveform. |
+------------------------------+-------------------------------------------------------------------------------------+
| Switching (2) | Measures the spectrum on the switching part of the waveform. |
+------------------------------+-------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.OrfsMeasurementType, int):
Specifies the type of spectral distortion to be measured.
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.OrfsMeasurementType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.ORFS_MEASUREMENT_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_offset_frequency_mode(self, selector_string):
r"""Gets the list of frequency offsets for which you can perform the output radio frequency spectrum (ORFS)
measurements.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **Standard**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Standard (0) | Uses the list of lower and upper offset frequencies of 100 kHz, 200 kHz, 250 kHz, 400 kHz, 600 kHz, 800 kHz, 1000 kHz, |
| | 1200 kHz, 1400 kHz, 1600 kHz, and 1800 kHz for the spectrum due to the modulation measurement, and the lower and upper |
| | offset frequencies of 400 kHz, 600 kHz, 1200 kHz, and 1800 kHz for the spectrum produced by the switching measurement. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Short (1) | Uses the list of lower and upper offset frequencies of 200 kHz, 250 kHz, 400 kHz, 600 kHz, and 1200 kHz for the |
| | spectrum due to the modulation measurement, and the lower and upper offset frequencies of 400 kHz, 600 kHz, 1200 kHz, |
| | and 1800 kHz for the spectrum produced by the switching measurement. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Custom (2) | Uses the list of frequencies that is configured using the RFmxGSM ORFS Configure Modulation Custom Offset Frequency |
| | (Array) and RFmxGSM ORFS Configure Switching Custom Offset Frequency (Array) methods for measurement of spectrum |
| | produced by modulation and switching measurements. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.OrfsOffsetFrequencyMode):
Specifies the list of frequency offsets for which you can perform the output radio frequency spectrum (ORFS)
measurements.
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.ORFS_OFFSET_FREQUENCY_MODE.value
)
attr_val = enums.OrfsOffsetFrequencyMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_offset_frequency_mode(self, selector_string, value):
r"""Sets the list of frequency offsets for which you can perform the output radio frequency spectrum (ORFS)
measurements.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **Standard**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Standard (0) | Uses the list of lower and upper offset frequencies of 100 kHz, 200 kHz, 250 kHz, 400 kHz, 600 kHz, 800 kHz, 1000 kHz, |
| | 1200 kHz, 1400 kHz, 1600 kHz, and 1800 kHz for the spectrum due to the modulation measurement, and the lower and upper |
| | offset frequencies of 400 kHz, 600 kHz, 1200 kHz, and 1800 kHz for the spectrum produced by the switching measurement. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Short (1) | Uses the list of lower and upper offset frequencies of 200 kHz, 250 kHz, 400 kHz, 600 kHz, and 1200 kHz for the |
| | spectrum due to the modulation measurement, and the lower and upper offset frequencies of 400 kHz, 600 kHz, 1200 kHz, |
| | and 1800 kHz for the spectrum produced by the switching measurement. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Custom (2) | Uses the list of frequencies that is configured using the RFmxGSM ORFS Configure Modulation Custom Offset Frequency |
| | (Array) and RFmxGSM ORFS Configure Switching Custom Offset Frequency (Array) methods for measurement of spectrum |
| | produced by modulation and switching measurements. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.OrfsOffsetFrequencyMode, int):
Specifies the list of frequency offsets for which you can perform the output radio frequency spectrum (ORFS)
measurements.
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.OrfsOffsetFrequencyMode else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ORFS_OFFSET_FREQUENCY_MODE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_evaluation_symbols_start(self, selector_string):
r"""Gets the start position within the useful part of the burst, in percentage, for measuring ORFS due to modulation.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 50.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the start position within the useful part of the burst, in percentage, for measuring ORFS due to modulation.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ORFS_EVALUATION_SYMBOLS_START.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_evaluation_symbols_start(self, selector_string, value):
r"""Sets the start position within the useful part of the burst, in percentage, for measuring ORFS due to modulation.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 50.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the start position within the useful part of the burst, in percentage, for measuring ORFS due to modulation.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.ORFS_EVALUATION_SYMBOLS_START.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_evaluation_symbols_include_tsc(self, selector_string):
r"""Gets whether to include the training sequence code (TSC) portion of burst for measuring ORFS due to modulation.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+======================================================================================+
| False (0) | The TSC portion of the burst will be excluded while performing the ORFS measurement. |
+--------------+--------------------------------------------------------------------------------------+
| True (1) | The TSC portion of the burst will be included while performing the ORFS measurement. |
+--------------+--------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.OrfsEvaluationSymbolsIncludeTsc):
Specifies whether to include the training sequence code (TSC) portion of burst for measuring ORFS due to modulation.
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.ORFS_EVALUATION_SYMBOLS_INCLUDE_TSC.value,
)
attr_val = enums.OrfsEvaluationSymbolsIncludeTsc(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_evaluation_symbols_include_tsc(self, selector_string, value):
r"""Sets whether to include the training sequence code (TSC) portion of burst for measuring ORFS due to modulation.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+======================================================================================+
| False (0) | The TSC portion of the burst will be excluded while performing the ORFS measurement. |
+--------------+--------------------------------------------------------------------------------------+
| True (1) | The TSC portion of the burst will be included while performing the ORFS measurement. |
+--------------+--------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.OrfsEvaluationSymbolsIncludeTsc, int):
Specifies whether to include the training sequence code (TSC) portion of burst for measuring ORFS due to modulation.
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.OrfsEvaluationSymbolsIncludeTsc else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ORFS_EVALUATION_SYMBOLS_INCLUDE_TSC.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_evaluation_symbols_stop(self, selector_string):
r"""Gets the stop position within the useful part of the burst, in percentage, for measuring ORFS due to modulation.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 90.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the stop position within the useful part of the burst, in percentage, for measuring ORFS due to modulation.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ORFS_EVALUATION_SYMBOLS_STOP.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_evaluation_symbols_stop(self, selector_string, value):
r"""Sets the stop position within the useful part of the burst, in percentage, for measuring ORFS due to modulation.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 90.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the stop position within the useful part of the burst, in percentage, for measuring ORFS due to modulation.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.ORFS_EVALUATION_SYMBOLS_STOP.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_evaluation_symbols_scope(self, selector_string):
r"""Gets the modulation power measurements that will use the part of burst configured using the
:py:meth:`configure_evaluation_symbols`.
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 **Offset**.
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+========================+==========================================================================================================================+
| Offset (0) | Modulation Offset Power measurements will only use the part of burst configured using the RFmxGSM ORFS Configure |
| | Evaluation Symbols method. Modulation Carrier Power measurement will use all of the useful part of the burst. |
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Offset and Carrier (1) | Modulation Offset and Carrier Power measurements will both use the part of burst configured using the RFmxGSM ORFS |
| | Configure Evaluation Symbols method. |
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.OrfsEvaluationSymbolsScope):
Specifies the modulation power measurements that will use the part of burst configured using the
:py:meth:`configure_evaluation_symbols`.
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.ORFS_EVALUATION_SYMBOLS_SCOPE.value
)
attr_val = enums.OrfsEvaluationSymbolsScope(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_evaluation_symbols_scope(self, selector_string, value):
r"""Sets the modulation power measurements that will use the part of burst configured using the
:py:meth:`configure_evaluation_symbols`.
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 **Offset**.
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+========================+==========================================================================================================================+
| Offset (0) | Modulation Offset Power measurements will only use the part of burst configured using the RFmxGSM ORFS Configure |
| | Evaluation Symbols method. Modulation Carrier Power measurement will use all of the useful part of the burst. |
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Offset and Carrier (1) | Modulation Offset and Carrier Power measurements will both use the part of burst configured using the RFmxGSM ORFS |
| | Configure Evaluation Symbols method. |
+------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.OrfsEvaluationSymbolsScope, int):
Specifies the modulation power measurements that will use the part of burst configured using the
:py:meth:`configure_evaluation_symbols`.
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.OrfsEvaluationSymbolsScope else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ORFS_EVALUATION_SYMBOLS_SCOPE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_modulation_carrier_rbw(self, selector_string):
r"""Gets the RBW used for measuring modulation carrier power in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 30kHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the RBW used for measuring modulation carrier power in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ORFS_MODULATION_CARRIER_RBW.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_modulation_carrier_rbw(self, selector_string, value):
r"""Sets the RBW used for measuring modulation carrier power in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 30kHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the RBW used for measuring modulation carrier power in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.ORFS_MODULATION_CARRIER_RBW.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_modulation_number_of_offsets(self, selector_string):
r"""Gets the number of positive frequency offsets relative to the frequency of the carrier for the measurement of the
spectrum due to modulation.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of positive frequency offsets relative to the frequency of the carrier for the measurement of the
spectrum due to modulation.
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.ORFS_MODULATION_NUMBER_OF_OFFSETS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_modulation_number_of_offsets(self, selector_string, value):
r"""Sets the number of positive frequency offsets relative to the frequency of the carrier for the measurement of the
spectrum due to modulation.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of positive frequency offsets relative to the frequency of the carrier for the measurement of the
spectrum due to modulation.
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.ORFS_MODULATION_NUMBER_OF_OFFSETS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_modulation_offset_frequency(self, selector_string):
r"""Gets the value of positive frequency offset for which to measure the spectrum due to modulation measurement. This
value is expressed in Hz.
Use "offset<*n*>" as the selector string to configure or read this attribute.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the value of positive frequency offset for which to measure the spectrum due to modulation measurement. This
value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f32(
updated_selector_string,
attributes.AttributeID.ORFS_MODULATION_OFFSET_FREQUENCY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_modulation_offset_frequency(self, selector_string, value):
r"""Sets the value of positive frequency offset for which to measure the spectrum due to modulation measurement. This
value is expressed in Hz.
Use "offset<*n*>" as the selector string to configure or read this attribute.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the value of positive frequency offset for which to measure the spectrum due to modulation measurement. This
value is expressed in Hz.
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_f32(
updated_selector_string,
attributes.AttributeID.ORFS_MODULATION_OFFSET_FREQUENCY.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_modulation_offset_rbw(self, selector_string):
r"""Gets the resolution bandwidth used for ORFS due to modulation measurement. This value is expressed in Hz.
Use "offset<*n*>" as the selector string to configure or read this attribute.
The default value is 30000.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the resolution bandwidth used for ORFS due to modulation measurement. This value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ORFS_MODULATION_OFFSET_RBW.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_switching_carrier_rbw(self, selector_string):
r"""Gets the RBW used for measuring switching carrier power in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 300kHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the RBW used for measuring switching carrier power in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ORFS_SWITCHING_CARRIER_RBW.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_switching_carrier_rbw(self, selector_string, value):
r"""Sets the RBW used for measuring switching carrier power in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 300kHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the RBW used for measuring switching carrier power in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.ORFS_SWITCHING_CARRIER_RBW.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_switching_number_of_offsets(self, selector_string):
r"""Gets the number of positive frequency offsets relative to the frequency of the carrier for the measurement of the
spectrum due to switching.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of positive frequency offsets relative to the frequency of the carrier for the measurement of the
spectrum due to switching.
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.ORFS_SWITCHING_NUMBER_OF_OFFSETS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_switching_number_of_offsets(self, selector_string, value):
r"""Sets the number of positive frequency offsets relative to the frequency of the carrier for the measurement of the
spectrum due to switching.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of positive frequency offsets relative to the frequency of the carrier for the measurement of the
spectrum due to switching.
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.ORFS_SWITCHING_NUMBER_OF_OFFSETS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_switching_offset_frequency(self, selector_string):
r"""Gets the value of positive frequency offset for which to measure the spectrum due to switching measurement. This
value is expressed in Hz.
Use "offset<*n*>" as the selector string to configure or read this attribute.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the value of positive frequency offset for which to measure the spectrum due to switching measurement. This
value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f32(
updated_selector_string,
attributes.AttributeID.ORFS_SWITCHING_OFFSET_FREQUENCY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_switching_offset_frequency(self, selector_string, value):
r"""Sets the value of positive frequency offset for which to measure the spectrum due to switching measurement. This
value is expressed in Hz.
Use "offset<*n*>" as the selector string to configure or read this attribute.
The default value is 0.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the value of positive frequency offset for which to measure the spectrum due to switching measurement. This
value is expressed in Hz.
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_f32(
updated_selector_string,
attributes.AttributeID.ORFS_SWITCHING_OFFSET_FREQUENCY.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_switching_offset_rbw(self, selector_string):
r"""Gets the resolution bandwidth used for ORFS due to switching measurement. This value is expressed in Hz.
Use "offset<*n*>" as the selector string to configure or read this attribute.
The default value is 30kHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the resolution bandwidth used for ORFS due to switching measurement. This value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.ORFS_SWITCHING_OFFSET_RBW.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_noise_compensation_enabled(self, selector_string):
r"""Gets whether to enable compensation of the channel powers for the inherent noise floor of the signal analyzer.
Noise compensation is applicable only on modulation offsets and not on switching offsets.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **False**.
**Supported Devices**: PXIe-5663/5665/5668R, PXIe-5830/5831/5832
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | Disables compensation of the channel powers for the signal analyzer noise floor. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | Enables compensation of the channel powers for the noise floor of the signal analyzer. The noise floor of the signal |
| | analyzer is measured for the RF path used by the output radio frequency spectrum (ORFS) measurement and cached for |
| | future use. If signal analyzer or measurement parameters change, noise floors are measured again. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.OrfsNoiseCompensationEnabled):
Specifies whether to enable compensation of the channel powers for the inherent noise floor of the signal analyzer.
Noise compensation is applicable only on modulation offsets and not on switching offsets.
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.ORFS_NOISE_COMPENSATION_ENABLED.value,
)
attr_val = enums.OrfsNoiseCompensationEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_noise_compensation_enabled(self, selector_string, value):
r"""Sets whether to enable compensation of the channel powers for the inherent noise floor of the signal analyzer.
Noise compensation is applicable only on modulation offsets and not on switching offsets.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is **False**.
**Supported Devices**: PXIe-5663/5665/5668R, PXIe-5830/5831/5832
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | Disables compensation of the channel powers for the signal analyzer noise floor. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | Enables compensation of the channel powers for the noise floor of the signal analyzer. The noise floor of the signal |
| | analyzer is measured for the RF path used by the output radio frequency spectrum (ORFS) measurement and cached for |
| | future use. If signal analyzer or measurement parameters change, noise floors are measured again. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.OrfsNoiseCompensationEnabled, int):
Specifies whether to enable compensation of the channel powers for the inherent noise floor of the signal analyzer.
Noise compensation is applicable only on modulation offsets and not on switching offsets.
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.OrfsNoiseCompensationEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.ORFS_NOISE_COMPENSATION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_all_traces_enabled(self, selector_string):
r"""Gets whether to enable the traces to be stored and retrieved after performing the output radio frequency spectrum
(ORFS) measurement.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (bool):
Specifies whether to enable the traces to be stored and retrieved after performing the output radio frequency spectrum
(ORFS) 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.ORFS_ALL_TRACES_ENABLED.value
)
attr_val = bool(attr_val)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_all_traces_enabled(self, selector_string, value):
r"""Sets whether to enable the traces to be stored and retrieved after performing the output radio frequency spectrum
(ORFS) measurement.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is FALSE.
Args:
selector_string (string):
Pass an empty string.
value (bool):
Specifies whether to enable the traces to be stored and retrieved after performing the output radio frequency spectrum
(ORFS) 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.ORFS_ALL_TRACES_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_number_of_analysis_threads(self, selector_string):
r"""Gets the maximum number of threads used for parallelism for the output radio frequency spectrum (ORFS)
measurement.
The number of threads can range from 1 to the number of physical cores. The number of threads you set may not
be used in calculations. The actual number of threads used depends on the problem size, system resources, data
availability, and other considerations.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 1.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the maximum number of threads used for parallelism for the output radio frequency spectrum (ORFS)
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.ORFS_NUMBER_OF_ANALYSIS_THREADS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_number_of_analysis_threads(self, selector_string, value):
r"""Sets the maximum number of threads used for parallelism for the output radio frequency spectrum (ORFS)
measurement.
The number of threads can range from 1 to the number of physical cores. The number of threads you set may not
be used in calculations. The actual number of threads used depends on the problem size, system resources, data
availability, and other considerations.
You do not need to use a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to configure or read this attribute for
the default signal instance. Refer to the Selector String topic for information about the string syntax for named
signals.
The default value is 1.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the maximum number of threads used for parallelism for the output radio frequency spectrum (ORFS)
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.ORFS_NUMBER_OF_ANALYSIS_THREADS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code