"""Provides methods to configure the Pulse measurement."""
import functools
import nirfmxpulse.attributes as attributes
import nirfmxpulse.enums as enums
import nirfmxpulse.errors as errors
import nirfmxpulse.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 Pulse signal configuration")
return f(*xs, **kws)
return aux
[docs]
class PulseConfiguration(object):
"""Provides methods to configure the Pulse measurement."""
def __init__(self, signal_obj):
"""Provides methods to configure the Pulse 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 pulse measurements are enabled.
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 pulse measurements are enabled.
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.PULSE_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 pulse measurements are enabled.
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 pulse measurements are enabled.
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.PULSE_MEASUREMENT_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_multiburst_enabled(self, selector_string):
r"""Gets whether to enable pulse measurements on the multiple burst transmission.
In multiburst mode, several pulses are grouped and transmitted in rapid succession, followed by a long pause
with no pulses, before another burst of pulses. Each pulse is assigned a burst index and position index within a burst.
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) | Multiburst disabled, assumes all pulses detected in the current acquisition are analysed as single burst. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | Multiburst enabled, assumes every burst in the acquisition contains pulses specified by Pulse Burst Length (Pulses) |
| | attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.MultiburstEnabled):
Specifies whether to enable pulse measurements on the multiple burst transmission.
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.PULSE_MULTIBURST_ENABLED.value
)
attr_val = enums.MultiburstEnabled(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_multiburst_enabled(self, selector_string, value):
r"""Sets whether to enable pulse measurements on the multiple burst transmission.
In multiburst mode, several pulses are grouped and transmitted in rapid succession, followed by a long pause
with no pulses, before another burst of pulses. Each pulse is assigned a burst index and position index within a burst.
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) | Multiburst disabled, assumes all pulses detected in the current acquisition are analysed as single burst. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | Multiburst enabled, assumes every burst in the acquisition contains pulses specified by Pulse Burst Length (Pulses) |
| | attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.MultiburstEnabled, int):
Specifies whether to enable pulse measurements on the multiple burst transmission.
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.MultiburstEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_MULTIBURST_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_multiburst_length(self, selector_string):
r"""Gets the number of pulses assigned to a single burst.
A minimum of 10 pulses per burst is required for pulse measurements.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of pulses assigned to a single burst.
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.PULSE_MULTIBURST_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_multiburst_length(self, selector_string, value):
r"""Sets the number of pulses assigned to a single burst.
A minimum of 10 pulses per burst is required for pulse measurements.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of pulses assigned to a single burst.
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.PULSE_MULTIBURST_LENGTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_detection_reference(self, selector_string):
r"""Gets the reference used for :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_DETECTION_THRESHOLD` 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 **Ref Level**.
+---------------+------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==================================================================+
| Ref Level (0) | The threshold is relative to the reference level of the samples. |
+---------------+------------------------------------------------------------------+
| Absolute (1) | The threshold is the absolute power, in dBm. |
+---------------+------------------------------------------------------------------+
| Peak (2) | The threshold is relative to the peak level of the samples. |
+---------------+------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseDetectionReference):
Specifies the reference used for :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_DETECTION_THRESHOLD` 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.PULSE_DETECTION_REFERENCE.value
)
attr_val = enums.PulseDetectionReference(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_detection_reference(self, selector_string, value):
r"""Sets the reference used for :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_DETECTION_THRESHOLD` 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 **Ref Level**.
+---------------+------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==================================================================+
| Ref Level (0) | The threshold is relative to the reference level of the samples. |
+---------------+------------------------------------------------------------------+
| Absolute (1) | The threshold is the absolute power, in dBm. |
+---------------+------------------------------------------------------------------+
| Peak (2) | The threshold is relative to the peak level of the samples. |
+---------------+------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseDetectionReference, int):
Specifies the reference used for :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_DETECTION_THRESHOLD` 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
)
value = value.value if type(value) is enums.PulseDetectionReference else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_DETECTION_REFERENCE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_detection_threshold(self, selector_string):
r"""Gets the threshold used for pulse detection. The unit dB or dBm is based on the value you set to the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_DETECTION_REFERENCE` 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 -20. Valid values are -100 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the threshold used for pulse detection. The unit dB or dBm is based on the value you set to the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_DETECTION_REFERENCE` 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_f64(
updated_selector_string, attributes.AttributeID.PULSE_DETECTION_THRESHOLD.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_detection_threshold(self, selector_string, value):
r"""Sets the threshold used for pulse detection. The unit dB or dBm is based on the value you set to the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_DETECTION_REFERENCE` 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 -20. Valid values are -100 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the threshold used for pulse detection. The unit dB or dBm is based on the value you set to the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_DETECTION_REFERENCE` 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_f64(
updated_selector_string,
attributes.AttributeID.PULSE_DETECTION_THRESHOLD.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_detection_hysteresis(self, selector_string):
r"""Gets the hysteresis for pulse detection in dB for the defined threshold.
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 0 to 50, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the hysteresis for pulse detection in dB for the defined threshold.
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.PULSE_DETECTION_HYSTERESIS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_detection_hysteresis(self, selector_string, value):
r"""Sets the hysteresis for pulse detection in dB for the defined threshold.
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 0 to 50, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the hysteresis for pulse detection in dB for the defined threshold.
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.PULSE_DETECTION_HYSTERESIS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_detection_minimum_off_duration(self, selector_string):
r"""Gets the minimum pulse off duration to be ignored by the pulse detection. This value is expressed in seconds.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.00000005. Valid values are 0 to 0.001, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the minimum pulse off duration to be ignored by the pulse detection. This value is expressed in seconds.
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.PULSE_DETECTION_MINIMUM_OFF_DURATION.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_detection_minimum_off_duration(self, selector_string, value):
r"""Sets the minimum pulse off duration to be ignored by the pulse detection. This value is expressed in seconds.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.00000005. Valid values are 0 to 0.001, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the minimum pulse off duration to be ignored by the pulse detection. This value is expressed in seconds.
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.PULSE_DETECTION_MINIMUM_OFF_DURATION.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_detection_minimum_width(self, selector_string):
r"""Gets the minimum pulse width time to be considered for pulse detection. Any detected pulse width time below the
specified value will be ignored by the pulse detection. This value is expressed in seconds.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.00000005 seconds.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the minimum pulse width time to be considered for pulse detection. Any detected pulse width time below the
specified value will be ignored by the pulse detection. This value is expressed in seconds.
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.PULSE_DETECTION_MINIMUM_WIDTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_detection_minimum_width(self, selector_string, value):
r"""Sets the minimum pulse width time to be considered for pulse detection. Any detected pulse width time below the
specified value will be ignored by the pulse detection. This value is expressed in seconds.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.00000005 seconds.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the minimum pulse width time to be considered for pulse detection. Any detected pulse width time below the
specified value will be ignored by the pulse detection. This value is expressed in seconds.
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.PULSE_DETECTION_MINIMUM_WIDTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_detection_maximum_width(self, selector_string):
r"""Gets the maximum pulse width time to be considered for pulse detection. Any detected pulse width time above the
specified value will be ignored by the pulse detection. This value is expressed in seconds.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.005 seconds.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the maximum pulse width time to be considered for pulse detection. Any detected pulse width time above the
specified value will be ignored by the pulse detection. This value is expressed in seconds.
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.PULSE_DETECTION_MAXIMUM_WIDTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_detection_maximum_width(self, selector_string, value):
r"""Sets the maximum pulse width time to be considered for pulse detection. Any detected pulse width time above the
specified value will be ignored by the pulse detection. This value is expressed in seconds.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 0.005 seconds.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the maximum pulse width time to be considered for pulse detection. Any detected pulse width time above the
specified value will be ignored by the pulse detection. This value is expressed in seconds.
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.PULSE_DETECTION_MAXIMUM_WIDTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_metrics_enabled(self, selector_string):
r"""Gets whether to enable pulse metrics results computation.
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) | Pulse Metric results computation is disabled. |
+--------------+-----------------------------------------------+
| True (1) | Pulse Metric results computation is enabled. |
+--------------+-----------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseMetricsEnabled):
Specifies whether to enable pulse metrics results computation.
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.PULSE_METRICS_ENABLED.value
)
attr_val = enums.PulseMetricsEnabled(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_metrics_enabled(self, selector_string, value):
r"""Sets whether to enable pulse metrics results computation.
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) | Pulse Metric results computation is disabled. |
+--------------+-----------------------------------------------+
| True (1) | Pulse Metric results computation is enabled. |
+--------------+-----------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseMetricsEnabled, int):
Specifies whether to enable pulse metrics results computation.
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.PulseMetricsEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.PULSE_METRICS_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_metrics_amplitude_deviation_unit(self, selector_string):
r"""Gets the unit for amplitude deviation results. This attribute is applicable only for droop, ripple and overshoot
results.
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 **Percentage**.
+----------------+-----------------------------------------------------------+
| Name (Value) | Description |
+================+===========================================================+
| Percentage (0) | Amplitude deviation results are returned as a percentage. |
+----------------+-----------------------------------------------------------+
| dB (1) | Amplitude deviation results are returned in dB. |
+----------------+-----------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseMetricsAmplitudeDeviationUnit):
Specifies the unit for amplitude deviation results. This attribute is applicable only for droop, ripple and overshoot
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.PULSE_METRICS_AMPLITUDE_DEVIATION_UNIT.value,
)
attr_val = enums.PulseMetricsAmplitudeDeviationUnit(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_metrics_amplitude_deviation_unit(self, selector_string, value):
r"""Sets the unit for amplitude deviation results. This attribute is applicable only for droop, ripple and overshoot
results.
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 **Percentage**.
+----------------+-----------------------------------------------------------+
| Name (Value) | Description |
+================+===========================================================+
| Percentage (0) | Amplitude deviation results are returned as a percentage. |
+----------------+-----------------------------------------------------------+
| dB (1) | Amplitude deviation results are returned in dB. |
+----------------+-----------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseMetricsAmplitudeDeviationUnit, int):
Specifies the unit for amplitude deviation results. This attribute is applicable only for droop, ripple and overshoot
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.PulseMetricsAmplitudeDeviationUnit else value
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_METRICS_AMPLITUDE_DEVIATION_UNIT.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_level_computation_method(self, selector_string):
r"""Gets the algorithm used to detect the pulse levels. The algorithm is based on the histogram method of level
detection as defined in *IEEE Std 181-2011*.
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 **Median**.
+--------------+--------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================+
| Mean (0) | The levels derived as the pulse sub-histogram mean levels. |
+--------------+--------------------------------------------------------------+
| Median (1) | The levels derived as the pulse sub-histogram median levels. |
+--------------+--------------------------------------------------------------+
| Mode (2) | The levels derived as the pulse sub-histogram mode levels. |
+--------------+--------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseLevelComputationMethod):
Specifies the algorithm used to detect the pulse levels. The algorithm is based on the histogram method of level
detection as defined in *IEEE Std 181-2011*.
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.PULSE_LEVEL_COMPUTATION_METHOD.value
)
attr_val = enums.PulseLevelComputationMethod(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_level_computation_method(self, selector_string, value):
r"""Sets the algorithm used to detect the pulse levels. The algorithm is based on the histogram method of level
detection as defined in *IEEE Std 181-2011*.
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 **Median**.
+--------------+--------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================+
| Mean (0) | The levels derived as the pulse sub-histogram mean levels. |
+--------------+--------------------------------------------------------------+
| Median (1) | The levels derived as the pulse sub-histogram median levels. |
+--------------+--------------------------------------------------------------+
| Mode (2) | The levels derived as the pulse sub-histogram mode levels. |
+--------------+--------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseLevelComputationMethod, int):
Specifies the algorithm used to detect the pulse levels. The algorithm is based on the histogram method of level
detection as defined in *IEEE Std 181-2011*.
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.PulseLevelComputationMethod else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_LEVEL_COMPUTATION_METHOD.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_amplitude_level_domain(self, selector_string):
r"""Gets whether voltage or power to be used as domain for pulse measurements.
The level thresholds are considered with a specified domain that impacts the timing results and level results
such as droop, overshoot and ripple.
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 **Volts**.
+--------------+------------------------------------------------------------+
| Name (Value) | Description |
+==============+============================================================+
| Volts (0) | All threshold levels are calculated in the voltage domain. |
+--------------+------------------------------------------------------------+
| Watts (1) | All threshold levels are calculated in the power domain. |
+--------------+------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseAmplitudeLevelDomain):
Specifies whether voltage or power to be used as domain for pulse 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.PULSE_AMPLITUDE_LEVEL_DOMAIN.value
)
attr_val = enums.PulseAmplitudeLevelDomain(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_amplitude_level_domain(self, selector_string, value):
r"""Sets whether voltage or power to be used as domain for pulse measurements.
The level thresholds are considered with a specified domain that impacts the timing results and level results
such as droop, overshoot and ripple.
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 **Volts**.
+--------------+------------------------------------------------------------+
| Name (Value) | Description |
+==============+============================================================+
| Volts (0) | All threshold levels are calculated in the voltage domain. |
+--------------+------------------------------------------------------------+
| Watts (1) | All threshold levels are calculated in the power domain. |
+--------------+------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseAmplitudeLevelDomain, int):
Specifies whether voltage or power to be used as domain for pulse 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.PulseAmplitudeLevelDomain else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_AMPLITUDE_LEVEL_DOMAIN.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_upper_threshold_level(self, selector_string):
r"""Gets the upper threshold level as a percentage of the pulse amplitude used to signify the end of a rising edge or
beginning of a falling edge.
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 90. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the upper threshold level as a percentage of the pulse amplitude used to signify the end of a rising edge or
beginning of a falling edge.
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.PULSE_UPPER_THRESHOLD_LEVEL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_upper_threshold_level(self, selector_string, value):
r"""Sets the upper threshold level as a percentage of the pulse amplitude used to signify the end of a rising edge or
beginning of a falling edge.
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 90. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the upper threshold level as a percentage of the pulse amplitude used to signify the end of a rising edge or
beginning of a falling edge.
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.PULSE_UPPER_THRESHOLD_LEVEL.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_width_threshold_level(self, selector_string):
r"""Gets the middle threshold level as a percentage of the pulse amplitude used to signify the mid-transition level
between pulse states used for pulse width computation.
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 50. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the middle threshold level as a percentage of the pulse amplitude used to signify the mid-transition level
between pulse states used for pulse width computation.
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.PULSE_WIDTH_THRESHOLD_LEVEL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_width_threshold_level(self, selector_string, value):
r"""Sets the middle threshold level as a percentage of the pulse amplitude used to signify the mid-transition level
between pulse states used for pulse width computation.
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 50. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the middle threshold level as a percentage of the pulse amplitude used to signify the mid-transition level
between pulse states used for pulse width computation.
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.PULSE_WIDTH_THRESHOLD_LEVEL.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_lower_threshold_level(self, selector_string):
r"""Gets the lower threshold level as a percentage of the pulse amplitude used to signify the start of a rising or end
of a falling edge.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the lower threshold level as a percentage of the pulse amplitude used to signify the start of a rising or end
of a falling edge.
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.PULSE_LOWER_THRESHOLD_LEVEL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_lower_threshold_level(self, selector_string, value):
r"""Sets the lower threshold level as a percentage of the pulse amplitude used to signify the start of a rising or end
of a falling edge.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the lower threshold level as a percentage of the pulse amplitude used to signify the start of a rising or end
of a falling edge.
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.PULSE_LOWER_THRESHOLD_LEVEL.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_droop_compensation_enabled(self, selector_string):
r"""Gets whether to compensate the droop detected in pulse level when applying thresholds.
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) | Droop Compensation is disabled. |
+--------------+---------------------------------+
| True (1) | Droop Compensation is enabled. |
+--------------+---------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseDroopCompensationEnabled):
Specifies whether to compensate the droop detected in pulse level when applying thresholds.
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.PULSE_DROOP_COMPENSATION_ENABLED.value,
)
attr_val = enums.PulseDroopCompensationEnabled(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_droop_compensation_enabled(self, selector_string, value):
r"""Sets whether to compensate the droop detected in pulse level when applying thresholds.
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) | Droop Compensation is disabled. |
+--------------+---------------------------------+
| True (1) | Droop Compensation is enabled. |
+--------------+---------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseDroopCompensationEnabled, int):
Specifies whether to compensate the droop detected in pulse level when applying thresholds.
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.PulseDroopCompensationEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_DROOP_COMPENSATION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_point_reference(self, selector_string):
r"""Gets the reference used for the measurement point calculation, in phase, frequency, and stability measurements.
You can set measurement point based on a reference and offset.
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 **Center**.
+--------------+---------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+===========================================================================+
| Rise (0) | The measurement point is defined in reference to the rising edge. |
+--------------+---------------------------------------------------------------------------+
| Center (1) | The measurement point is defined in reference to the center of the pulse. |
+--------------+---------------------------------------------------------------------------+
| Fall (2) | The measurement point is defined in reference to the falling edge. |
+--------------+---------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseMeasurementPointReference):
Specifies the reference used for the measurement point calculation, in phase, frequency, and stability measurements.
You can set measurement point based on a reference and offset.
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.PULSE_MEASUREMENT_POINT_REFERENCE.value,
)
attr_val = enums.PulseMeasurementPointReference(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_point_reference(self, selector_string, value):
r"""Sets the reference used for the measurement point calculation, in phase, frequency, and stability measurements.
You can set measurement point based on a reference and offset.
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 **Center**.
+--------------+---------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+===========================================================================+
| Rise (0) | The measurement point is defined in reference to the rising edge. |
+--------------+---------------------------------------------------------------------------+
| Center (1) | The measurement point is defined in reference to the center of the pulse. |
+--------------+---------------------------------------------------------------------------+
| Fall (2) | The measurement point is defined in reference to the falling edge. |
+--------------+---------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseMeasurementPointReference, int):
Specifies the reference used for the measurement point calculation, in phase, frequency, and stability measurements.
You can set measurement point based on a reference and offset.
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.PulseMeasurementPointReference else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_MEASUREMENT_POINT_REFERENCE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_point_offset(self, selector_string):
r"""Gets the time offset of the measurement point within the pulse for phase, frequency, and stability measurements.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the time offset of the measurement point within the pulse for phase, frequency, and stability 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_f64(
updated_selector_string, attributes.AttributeID.PULSE_MEASUREMENT_POINT_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_point_offset(self, selector_string, value):
r"""Sets the time offset of the measurement point within the pulse for phase, frequency, and stability measurements.
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.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the time offset of the measurement point within the pulse for phase, frequency, and stability 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
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.PULSE_MEASUREMENT_POINT_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_measurement_point_averaging_duration(self, selector_string):
r"""Gets the length of the averaging window centered at the measurement point. A minimum of 1 sample is used
internally.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the length of the averaging window centered at the measurement point. A minimum of 1 sample is used
internally.
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.PULSE_MEASUREMENT_POINT_AVERAGING_DURATION.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_measurement_point_averaging_duration(self, selector_string, value):
r"""Sets the length of the averaging window centered at the measurement point. A minimum of 1 sample is used
internally.
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.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the length of the averaging window centered at the measurement point. A minimum of 1 sample is used
internally.
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.PULSE_MEASUREMENT_POINT_AVERAGING_DURATION.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_multiple_measurement_points_enabled(self, selector_string):
r"""Gets whether to enable pulse stability measurements on multiple measurement points. This attribute enables the
stability traces over multiple measurement points when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ALL_TRACES_ENABLED` attribute to TRUE.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================+
| False (0) | Multiple Measurement Points related computation is disabled. |
+--------------+--------------------------------------------------------------+
| True (1) | Multiple Measurement Points related computation is enabled. |
+--------------+--------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseMultipleMeasurementPointsEnabled):
Specifies whether to enable pulse stability measurements on multiple measurement points. This attribute enables the
stability traces over multiple measurement points when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ALL_TRACES_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.PULSE_MULTIPLE_MEASUREMENT_POINTS_ENABLED.value,
)
attr_val = enums.PulseMultipleMeasurementPointsEnabled(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_multiple_measurement_points_enabled(self, selector_string, value):
r"""Sets whether to enable pulse stability measurements on multiple measurement points. This attribute enables the
stability traces over multiple measurement points when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ALL_TRACES_ENABLED` attribute to TRUE.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+--------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================+
| False (0) | Multiple Measurement Points related computation is disabled. |
+--------------+--------------------------------------------------------------+
| True (1) | Multiple Measurement Points related computation is enabled. |
+--------------+--------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseMultipleMeasurementPointsEnabled, int):
Specifies whether to enable pulse stability measurements on multiple measurement points. This attribute enables the
stability traces over multiple measurement points when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ALL_TRACES_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
)
value = (
value.value if type(value) is enums.PulseMultipleMeasurementPointsEnabled else value
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_MULTIPLE_MEASUREMENT_POINTS_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_multiple_measurement_points_window_start(self, selector_string):
r"""Gets the start of the measurement window used for multiple measurement points selection over pulse ON duration.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 20. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the start of the measurement window used for multiple measurement points selection over pulse ON duration.
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.PULSE_MULTIPLE_MEASUREMENT_POINTS_WINDOW_START.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_multiple_measurement_points_window_start(self, selector_string, value):
r"""Sets the start of the measurement window used for multiple measurement points selection over pulse ON duration.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 20. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the start of the measurement window used for multiple measurement points selection over pulse ON duration.
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.PULSE_MULTIPLE_MEASUREMENT_POINTS_WINDOW_START.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_multiple_measurement_points_window_stop(self, selector_string):
r"""Gets the stop of the measurement window used for multiple measurement points selection over pulse ON duration.
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 80. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the stop of the measurement window used for multiple measurement points selection over pulse ON duration.
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.PULSE_MULTIPLE_MEASUREMENT_POINTS_WINDOW_STOP.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_multiple_measurement_points_window_stop(self, selector_string, value):
r"""Sets the stop of the measurement window used for multiple measurement points selection over pulse ON duration.
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 80. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the stop of the measurement window used for multiple measurement points selection over pulse ON duration.
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.PULSE_MULTIPLE_MEASUREMENT_POINTS_WINDOW_STOP.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_multiple_measurement_points_window_step_size(self, selector_string):
r"""Gets the step size of multiple measurement points selection within the measurement window over pulse ON duration.
A minimum of 1 sample step size is used internally.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the step size of multiple measurement points selection within the measurement window over pulse ON duration.
A minimum of 1 sample step size is used internally.
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.PULSE_MULTIPLE_MEASUREMENT_POINTS_WINDOW_STEP_SIZE.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_multiple_measurement_points_window_step_size(self, selector_string, value):
r"""Sets the step size of multiple measurement points selection within the measurement window over pulse ON duration.
A minimum of 1 sample step size is used internally.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the step size of multiple measurement points selection within the measurement window over pulse ON duration.
A minimum of 1 sample step size is used internally.
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.PULSE_MULTIPLE_MEASUREMENT_POINTS_WINDOW_STEP_SIZE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_frequency_and_phase_deviation_range_reference(self, selector_string):
r"""Gets the reference used for the measurement range in phase/frequency deviation and error measurements.
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 **Center**.
+--------------+--------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================+
| Edge (0) | Specifies the range with respect to the edges of the pulse. |
+--------------+--------------------------------------------------------------+
| Center (1) | Specifies the range with respect to the center of the pulse. |
+--------------+--------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseFrequencyAndPhaseDeviationRangeReference):
Specifies the reference used for the measurement range in phase/frequency deviation and error 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.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE.value,
)
attr_val = enums.PulseFrequencyAndPhaseDeviationRangeReference(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_frequency_and_phase_deviation_range_reference(self, selector_string, value):
r"""Sets the reference used for the measurement range in phase/frequency deviation and error measurements.
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 **Center**.
+--------------+--------------------------------------------------------------+
| Name (Value) | Description |
+==============+==============================================================+
| Edge (0) | Specifies the range with respect to the edges of the pulse. |
+--------------+--------------------------------------------------------------+
| Center (1) | Specifies the range with respect to the center of the pulse. |
+--------------+--------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseFrequencyAndPhaseDeviationRangeReference, int):
Specifies the reference used for the measurement range in phase/frequency deviation and error 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.PulseFrequencyAndPhaseDeviationRangeReference
else value
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_frequency_and_phase_deviation_range_length(self, selector_string):
r"""Gets the length of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Center**.
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 75. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the length of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Center**.
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.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_LENGTH.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_frequency_and_phase_deviation_range_length(self, selector_string, value):
r"""Sets the length of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Center**.
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 75. Valid values are 0 to 100, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the length of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Center**.
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.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_LENGTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_frequency_and_phase_deviation_range_edge_start(self, selector_string):
r"""Gets the start of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Edge**.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the start of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Edge**.
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.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_EDGE_START.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_frequency_and_phase_deviation_range_edge_start(self, selector_string, value):
r"""Sets the start of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Edge**.
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.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the start of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Edge**.
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.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_EDGE_START.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_frequency_and_phase_deviation_range_edge_stop(self, selector_string):
r"""Gets the stop of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Edge**.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the stop of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Edge**.
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.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_EDGE_STOP.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_frequency_and_phase_deviation_range_edge_stop(self, selector_string, value):
r"""Sets the stop of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Edge**.
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.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the stop of the pulse data used for the phase/frequency deviation and error measurements when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_REFERENCE` attribute to
**Edge**.
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.PULSE_FREQUENCY_AND_PHASE_DEVIATION_RANGE_EDGE_STOP.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_frequency_and_phase_modulation_type(self, selector_string):
r"""Gets the pulse modulation type used for the phase and frequency error, and pulsed FM 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 **CW**.
+-------------------+-------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===================+===========================================================================================+
| CW (0) | Continous wave where the frequency remains constant over pulse ON duration. |
+-------------------+-------------------------------------------------------------------------------------------+
| Linear FM (1) | Frequency varies linearly within pulse ON duration. |
+-------------------+-------------------------------------------------------------------------------------------+
| Triangular FM (2) | Frequency varies with two lienar FM chirps with opposite slopes within pulse ON duration. |
+-------------------+-------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseModulationType):
Specifies the pulse modulation type used for the phase and frequency error, and pulsed FM 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.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE.value,
)
attr_val = enums.PulseModulationType(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_frequency_and_phase_modulation_type(self, selector_string, value):
r"""Sets the pulse modulation type used for the phase and frequency error, and pulsed FM 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 **CW**.
+-------------------+-------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===================+===========================================================================================+
| CW (0) | Continous wave where the frequency remains constant over pulse ON duration. |
+-------------------+-------------------------------------------------------------------------------------------+
| Linear FM (1) | Frequency varies linearly within pulse ON duration. |
+-------------------+-------------------------------------------------------------------------------------------+
| Triangular FM (2) | Frequency varies with two lienar FM chirps with opposite slopes within pulse ON duration. |
+-------------------+-------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseModulationType, int):
Specifies the pulse modulation type used for the phase and frequency error, and pulsed FM 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.PulseModulationType else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_frequency_and_phase_cw_frequency_offset_auto(self, selector_string):
r"""Gets whether the CW frequency offset computation of every detected pulse is automatic or manual. This attribute is
valid only when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE`
attribute to **CW**.
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) | CW frequency offset computation is set to manual. |
+--------------+------------------------------------------------------+
| True (1) | CW frequency offset computation is set to automatic. |
+--------------+------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseCWFrequencyOffsetAuto):
Specifies whether the CW frequency offset computation of every detected pulse is automatic or manual. This attribute is
valid only when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE`
attribute to **CW**.
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.PULSE_FREQUENCY_AND_PHASE_CW_FREQUENCY_OFFSET_AUTO.value,
)
attr_val = enums.PulseCWFrequencyOffsetAuto(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_frequency_and_phase_cw_frequency_offset_auto(self, selector_string, value):
r"""Sets whether the CW frequency offset computation of every detected pulse is automatic or manual. This attribute is
valid only when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE`
attribute to **CW**.
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) | CW frequency offset computation is set to manual. |
+--------------+------------------------------------------------------+
| True (1) | CW frequency offset computation is set to automatic. |
+--------------+------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseCWFrequencyOffsetAuto, int):
Specifies whether the CW frequency offset computation of every detected pulse is automatic or manual. This attribute is
valid only when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE`
attribute to **CW**.
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.PulseCWFrequencyOffsetAuto else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_CW_FREQUENCY_OFFSET_AUTO.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_frequency_and_phase_cw_frequency_offset(self, selector_string):
r"""Gets to manually enter the CW frequency offset. This attribute is valid only when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE` attribute to **CW**.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies to manually enter the CW frequency offset. This attribute is valid only when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE` attribute to **CW**.
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.PULSE_FREQUENCY_AND_PHASE_CW_FREQUENCY_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_frequency_and_phase_cw_frequency_offset(self, selector_string, value):
r"""Sets to manually enter the CW frequency offset. This attribute is valid only when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE` attribute to **CW**.
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.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies to manually enter the CW frequency offset. This attribute is valid only when you set the
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_FREQUENCY_AND_PHASE_MODULATION_TYPE` attribute to **CW**.
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.PULSE_FREQUENCY_AND_PHASE_CW_FREQUENCY_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_stability_enabled(self, selector_string):
r"""Gets whether to enable pulse stability results computation.
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) | Pulse Stability results computation is disabled. |
+--------------+--------------------------------------------------+
| True (1) | Pulse Stability results computation is enabled. |
+--------------+--------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseStabilityEnabled):
Specifies whether to enable pulse stability results computation.
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.PULSE_STABILITY_ENABLED.value
)
attr_val = enums.PulseStabilityEnabled(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_stability_enabled(self, selector_string, value):
r"""Sets whether to enable pulse stability results computation.
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) | Pulse Stability results computation is disabled. |
+--------------+--------------------------------------------------+
| True (1) | Pulse Stability results computation is enabled. |
+--------------+--------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseStabilityEnabled, int):
Specifies whether to enable pulse stability results computation.
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.PulseStabilityEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.PULSE_STABILITY_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_stability_measurement_offset(self, selector_string):
r"""Gets the offset in number of pulses to be used for pulse stability measurement. This attribute is applicable for
average stability results and pulse-to-pulse stabilty trace.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the offset in number of pulses to be used for pulse stability measurement. This attribute is applicable for
average stability results and pulse-to-pulse stabilty trace.
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.PULSE_STABILITY_MEASUREMENT_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_stability_measurement_offset(self, selector_string, value):
r"""Sets the offset in number of pulses to be used for pulse stability measurement. This attribute is applicable for
average stability results and pulse-to-pulse stabilty trace.
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.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the offset in number of pulses to be used for pulse stability measurement. This attribute is applicable for
average stability results and pulse-to-pulse stabilty trace.
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.PULSE_STABILITY_MEASUREMENT_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_stability_reference_offset(self, selector_string):
r"""Gets the offset in number of pulses used for pulse stability reference computation.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the offset in number of pulses used for pulse stability reference computation.
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.PULSE_STABILITY_REFERENCE_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_stability_reference_offset(self, selector_string, value):
r"""Sets the offset in number of pulses used for pulse stability reference computation.
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.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the offset in number of pulses used for pulse stability reference computation.
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.PULSE_STABILITY_REFERENCE_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_stability_pulse_to_pulse_offset(self, selector_string):
r"""Gets the offset in number of pulses used for pulse-to-pulse stability measurement trace.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the offset in number of pulses used for pulse-to-pulse stability measurement trace.
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.PULSE_STABILITY_PULSE_TO_PULSE_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_stability_pulse_to_pulse_offset(self, selector_string, value):
r"""Sets the offset in number of pulses used for pulse-to-pulse stability measurement trace.
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.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the offset in number of pulses used for pulse-to-pulse stability measurement trace.
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.PULSE_STABILITY_PULSE_TO_PULSE_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_stability_frequency_error_compensation(self, selector_string):
r"""Gets whether to compute and correct the frequency offset for stability results computation. This is an optional
setting and in negligible frequency error condition you must set this attribute to Off to avoid incorrect results.
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 **On**.
+--------------+-------------------------------------------+
| Name (Value) | Description |
+==============+===========================================+
| Off (0) | Frequency error compensation is disabled. |
+--------------+-------------------------------------------+
| On (1) | Frequency error compensation is enabled. |
+--------------+-------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseStabilityFrequencyErrorCompensation):
Specifies whether to compute and correct the frequency offset for stability results computation. This is an optional
setting and in negligible frequency error condition you must set this attribute to Off to avoid incorrect 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.PULSE_STABILITY_FREQUENCY_ERROR_COMPENSATION.value,
)
attr_val = enums.PulseStabilityFrequencyErrorCompensation(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_stability_frequency_error_compensation(self, selector_string, value):
r"""Sets whether to compute and correct the frequency offset for stability results computation. This is an optional
setting and in negligible frequency error condition you must set this attribute to Off to avoid incorrect results.
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 **On**.
+--------------+-------------------------------------------+
| Name (Value) | Description |
+==============+===========================================+
| Off (0) | Frequency error compensation is disabled. |
+--------------+-------------------------------------------+
| On (1) | Frequency error compensation is enabled. |
+--------------+-------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseStabilityFrequencyErrorCompensation, int):
Specifies whether to compute and correct the frequency offset for stability results computation. This is an optional
setting and in negligible frequency error condition you must set this attribute to Off to avoid incorrect 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.PulseStabilityFrequencyErrorCompensation
else value
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_STABILITY_FREQUENCY_ERROR_COMPENSATION.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_time_sidelobe_enabled(self, selector_string):
r"""Gets whether to enable pulse time sidelobe results computation. You can use the `RFmxPulse Configure Reference
Waveform (1 Wfm) <rfmxpulsevi.chm/RFmxPulse_Configure_Reference_Waveform_(1_Wfm).html>`_ method to set the reference
waveform for correlation computation.
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) | Pulse Time Sidelobe results computation is disabled. |
+--------------+------------------------------------------------------+
| True (1) | Pulse Time Sidelobe results computation is enabled. |
+--------------+------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseTimeSidelobeEnabled):
Specifies whether to enable pulse time sidelobe results computation. You can use the `RFmxPulse Configure Reference
Waveform (1 Wfm) <rfmxpulsevi.chm/RFmxPulse_Configure_Reference_Waveform_(1_Wfm).html>`_ method to set the reference
waveform for correlation computation.
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.PULSE_TIME_SIDELOBE_ENABLED.value
)
attr_val = enums.PulseTimeSidelobeEnabled(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_time_sidelobe_enabled(self, selector_string, value):
r"""Sets whether to enable pulse time sidelobe results computation. You can use the `RFmxPulse Configure Reference
Waveform (1 Wfm) <rfmxpulsevi.chm/RFmxPulse_Configure_Reference_Waveform_(1_Wfm).html>`_ method to set the reference
waveform for correlation computation.
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) | Pulse Time Sidelobe results computation is disabled. |
+--------------+------------------------------------------------------+
| True (1) | Pulse Time Sidelobe results computation is enabled. |
+--------------+------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseTimeSidelobeEnabled, int):
Specifies whether to enable pulse time sidelobe results computation. You can use the `RFmxPulse Configure Reference
Waveform (1 Wfm) <rfmxpulsevi.chm/RFmxPulse_Configure_Reference_Waveform_(1_Wfm).html>`_ method to set the reference
waveform for correlation computation.
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.PulseTimeSidelobeEnabled else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_TIME_SIDELOBE_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_time_sidelobe_reference_window_type(self, selector_string):
r"""Gets the window type to be applied to the reference pulse to obtain correlated output for the time sidelobe
measurements.
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 **None**.
+---------------------+----------------------------------+
| Name (Value) | Description |
+=====================+==================================+
| None (0) | Indicates no windowing. |
+---------------------+----------------------------------+
| Flat Top (1) | Indicates Flat Top window type. |
+---------------------+----------------------------------+
| Hanning (2) | Indicates Hanning window type. |
+---------------------+----------------------------------+
| Hamming (3) | Indicates Hamming window type. |
+---------------------+----------------------------------+
| Gaussian (4) | Indicates Gaussian window type. |
+---------------------+----------------------------------+
| Blackman (5) | Indicates Blackman window type. |
+---------------------+----------------------------------+
| Dolph-Chebyshev (6) | Indicates Chebyshev window type. |
+---------------------+----------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseTimeSidelobeReferenceWindowType):
Specifies the window type to be applied to the reference pulse to obtain correlated output for the time sidelobe
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.PULSE_TIME_SIDELOBE_REFERENCE_WINDOW_TYPE.value,
)
attr_val = enums.PulseTimeSidelobeReferenceWindowType(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_time_sidelobe_reference_window_type(self, selector_string, value):
r"""Sets the window type to be applied to the reference pulse to obtain correlated output for the time sidelobe
measurements.
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 **None**.
+---------------------+----------------------------------+
| Name (Value) | Description |
+=====================+==================================+
| None (0) | Indicates no windowing. |
+---------------------+----------------------------------+
| Flat Top (1) | Indicates Flat Top window type. |
+---------------------+----------------------------------+
| Hanning (2) | Indicates Hanning window type. |
+---------------------+----------------------------------+
| Hamming (3) | Indicates Hamming window type. |
+---------------------+----------------------------------+
| Gaussian (4) | Indicates Gaussian window type. |
+---------------------+----------------------------------+
| Blackman (5) | Indicates Blackman window type. |
+---------------------+----------------------------------+
| Dolph-Chebyshev (6) | Indicates Chebyshev window type. |
+---------------------+----------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseTimeSidelobeReferenceWindowType, int):
Specifies the window type to be applied to the reference pulse to obtain correlated output for the time sidelobe
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.PulseTimeSidelobeReferenceWindowType else value
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_TIME_SIDELOBE_REFERENCE_WINDOW_TYPE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_time_sidelobe_keep_out_time_auto(self, selector_string):
r"""Gets whether the keep out time computation for the time sidelobe measurements is automatic or manual.
Defines excluded region in the correlated output to distinguish the sidelobes from the main lobe for time
sidelobe measurements.
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) | Keep out time computation is set to manual specifified by Pulse Time Sidelobe Keep Out Time (s) attribute. |
+--------------+------------------------------------------------------------------------------------------------------------+
| True (1) | Keep out time computation is set to automatic, determined mainlobe 3dB width is used. |
+--------------+------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseTimeSidelobeKeepOutTimeAuto):
Specifies whether the keep out time computation for the time sidelobe measurements is automatic or manual.
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.PULSE_TIME_SIDELOBE_KEEP_OUT_TIME_AUTO.value,
)
attr_val = enums.PulseTimeSidelobeKeepOutTimeAuto(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_time_sidelobe_keep_out_time_auto(self, selector_string, value):
r"""Sets whether the keep out time computation for the time sidelobe measurements is automatic or manual.
Defines excluded region in the correlated output to distinguish the sidelobes from the main lobe for time
sidelobe measurements.
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) | Keep out time computation is set to manual specifified by Pulse Time Sidelobe Keep Out Time (s) attribute. |
+--------------+------------------------------------------------------------------------------------------------------------+
| True (1) | Keep out time computation is set to automatic, determined mainlobe 3dB width is used. |
+--------------+------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseTimeSidelobeKeepOutTimeAuto, int):
Specifies whether the keep out time computation for the time sidelobe measurements is automatic or manual.
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.PulseTimeSidelobeKeepOutTimeAuto else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_TIME_SIDELOBE_KEEP_OUT_TIME_AUTO.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_time_sidelobe_keep_out_time(self, selector_string):
r"""Gets keep out time for the time sidelobe measurements.
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.000001 seconds.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies keep out time for the time sidelobe 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_f64(
updated_selector_string,
attributes.AttributeID.PULSE_TIME_SIDELOBE_KEEP_OUT_TIME.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_time_sidelobe_keep_out_time(self, selector_string, value):
r"""Sets keep out time for the time sidelobe measurements.
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.000001 seconds.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies keep out time for the time sidelobe 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
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.PULSE_TIME_SIDELOBE_KEEP_OUT_TIME.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_time_sidelobe_minimum_correlation(self, selector_string):
r"""Gets the minimum peak correlation value for the time sidelobe measurements.
Time sidelobe measurements for the given pulse is computed only if the peak correlation value crosses the
minimum correlation value.
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.5.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the minimum peak correlation value for the time sidelobe 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_f64(
updated_selector_string,
attributes.AttributeID.PULSE_TIME_SIDELOBE_MINIMUM_CORRELATION.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_time_sidelobe_minimum_correlation(self, selector_string, value):
r"""Sets the minimum peak correlation value for the time sidelobe measurements.
Time sidelobe measurements for the given pulse is computed only if the peak correlation value crosses the
minimum correlation value.
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.5.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the minimum peak correlation value for the time sidelobe 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
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.PULSE_TIME_SIDELOBE_MINIMUM_CORRELATION.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 storing and retrieving traces after performing the measurements.
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 storing and retrieving traces after performing the 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.PULSE_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 storing and retrieving traces after performing the measurements.
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 storing and retrieving traces after performing the 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
)
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_ALL_TRACES_ENABLED.value,
int(value),
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_acquisition_trace_select(self, selector_string):
r"""Gets the mode to select all pulses or the subset of acquired pulses available for display acquisition trace,
limited to :py:attr:`~nirfmxpulse.attributes.AttributeID.MAXIMUM_PULSE_COUNT_ENABLED` attribute if set to **True**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Subset**.
+----------------+----------------------------------+
| Name (Value) | Description |
+================+==================================+
| All Pulses (0) | Selects all the acquired pulses. |
+----------------+----------------------------------+
| Subset (1) | |
+----------------+----------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseAcquisitionTraceSelect):
Specifies the mode to select all pulses or the subset of acquired pulses available for display acquisition trace,
limited to :py:attr:`~nirfmxpulse.attributes.AttributeID.MAXIMUM_PULSE_COUNT_ENABLED` attribute if set 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.PULSE_ACQUISITION_TRACE_SELECT.value
)
attr_val = enums.PulseAcquisitionTraceSelect(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_acquisition_trace_select(self, selector_string, value):
r"""Sets the mode to select all pulses or the subset of acquired pulses available for display acquisition trace,
limited to :py:attr:`~nirfmxpulse.attributes.AttributeID.MAXIMUM_PULSE_COUNT_ENABLED` attribute if set to **True**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **Subset**.
+----------------+----------------------------------+
| Name (Value) | Description |
+================+==================================+
| All Pulses (0) | Selects all the acquired pulses. |
+----------------+----------------------------------+
| Subset (1) | |
+----------------+----------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseAcquisitionTraceSelect, int):
Specifies the mode to select all pulses or the subset of acquired pulses available for display acquisition trace,
limited to :py:attr:`~nirfmxpulse.attributes.AttributeID.MAXIMUM_PULSE_COUNT_ENABLED` attribute if set 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
)
value = value.value if type(value) is enums.PulseAcquisitionTraceSelect else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_acquisition_trace_subset_offset(self, selector_string):
r"""Gets the offset in number of pulses to be used for display acquisition trace. You must configure this attribute
when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT` attribute to **Subset**.
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 to 9999, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the offset in number of pulses to be used for display acquisition trace. You must configure this attribute
when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT` attribute to **Subset**.
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.PULSE_ACQUISITION_TRACE_SUBSET_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_acquisition_trace_subset_offset(self, selector_string, value):
r"""Sets the offset in number of pulses to be used for display acquisition trace. You must configure this attribute
when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT` attribute to **Subset**.
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 to 9999, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the offset in number of pulses to be used for display acquisition trace. You must configure this attribute
when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT` attribute to **Subset**.
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.PULSE_ACQUISITION_TRACE_SUBSET_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_acquisition_trace_subset_length(self, selector_string):
r"""Gets the total number of pulses starting from offset to be used for display acquisition trace. You must configure
this attribute when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT` attribute
to **Subset**.
Set length to 0 to disable the acquisition trace.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10. Valid values are 0 to 10000, inclusive.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the total number of pulses starting from offset to be used for display acquisition trace. You must configure
this attribute when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT` attribute
to **Subset**.
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.PULSE_ACQUISITION_TRACE_SUBSET_LENGTH.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_acquisition_trace_subset_length(self, selector_string, value):
r"""Sets the total number of pulses starting from offset to be used for display acquisition trace. You must configure
this attribute when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT` attribute
to **Subset**.
Set length to 0 to disable the acquisition trace.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 10. Valid values are 0 to 10000, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the total number of pulses starting from offset to be used for display acquisition trace. You must configure
this attribute when you set the :py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_ACQUISITION_TRACE_SELECT` attribute
to **Subset**.
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.PULSE_ACQUISITION_TRACE_SUBSET_LENGTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_trace_range_auto(self, selector_string):
r"""Gets whether the trace range computation of the selected pulse is automatic or manually configured by you.
This attribute is applicable for IQ, amplitude, phase and frequency traces.
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) | Trace range computation is set to manual. |
+--------------+---------------------------------------------------------------------+
| True (1) | Trace range is automatically computed according to the pulse width. |
+--------------+---------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseTraceRangeAuto):
Specifies whether the trace range computation of the selected pulse is automatic or manually configured by you.
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.PULSE_TRACE_RANGE_AUTO.value
)
attr_val = enums.PulseTraceRangeAuto(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_trace_range_auto(self, selector_string, value):
r"""Sets whether the trace range computation of the selected pulse is automatic or manually configured by you.
This attribute is applicable for IQ, amplitude, phase and frequency traces.
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) | Trace range computation is set to manual. |
+--------------+---------------------------------------------------------------------+
| True (1) | Trace range is automatically computed according to the pulse width. |
+--------------+---------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseTraceRangeAuto, int):
Specifies whether the trace range computation of the selected pulse is automatic or manually configured by you.
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.PulseTraceRangeAuto else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string, attributes.AttributeID.PULSE_TRACE_RANGE_AUTO.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_trace_range_reference(self, selector_string):
r"""Gets the reference point for positioning of trace range. You can set reference point based on reference and
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_TRACE_RANGE_OFFSET` value.
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 **Center**.
+--------------+-----------------------------------------------------------------+
| Name (Value) | Description |
+==============+=================================================================+
| Rise (0) | Trace range is defined in reference to the rising edge. |
+--------------+-----------------------------------------------------------------+
| Center (1) | Trace range is defined in reference to the center of the pulse. |
+--------------+-----------------------------------------------------------------+
| Fall (2) | Trace range is defined in reference to the falling edge. |
+--------------+-----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseTraceRangeReference):
Specifies the reference point for positioning of trace range. You can set reference point based on reference and
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_TRACE_RANGE_OFFSET` value.
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.PULSE_TRACE_RANGE_REFERENCE.value
)
attr_val = enums.PulseTraceRangeReference(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_trace_range_reference(self, selector_string, value):
r"""Sets the reference point for positioning of trace range. You can set reference point based on reference and
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_TRACE_RANGE_OFFSET` value.
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 **Center**.
+--------------+-----------------------------------------------------------------+
| Name (Value) | Description |
+==============+=================================================================+
| Rise (0) | Trace range is defined in reference to the rising edge. |
+--------------+-----------------------------------------------------------------+
| Center (1) | Trace range is defined in reference to the center of the pulse. |
+--------------+-----------------------------------------------------------------+
| Fall (2) | Trace range is defined in reference to the falling edge. |
+--------------+-----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseTraceRangeReference, int):
Specifies the reference point for positioning of trace range. You can set reference point based on reference and
:py:attr:`~nirfmxpulse.attributes.AttributeID.PULSE_TRACE_RANGE_OFFSET` value.
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.PulseTraceRangeReference else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_TRACE_RANGE_REFERENCE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_trace_range_offset(self, selector_string):
r"""Gets the time offset in seconds from the reference point to position the trace range.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the time offset in seconds from the reference point to position the trace range.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.PULSE_TRACE_RANGE_OFFSET.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_trace_range_offset(self, selector_string, value):
r"""Sets the time offset in seconds from the reference point to position the trace range.
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.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the time offset in seconds from the reference point to position the trace range.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.set_attribute_f64(
updated_selector_string,
attributes.AttributeID.PULSE_TRACE_RANGE_OFFSET.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_trace_range_length(self, selector_string):
r"""Gets the length in seconds of the trace range centered at the reference point.
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.000020 seconds.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the length in seconds of the trace range centered at the reference point.
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.PULSE_TRACE_RANGE_LENGTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_trace_range_length(self, selector_string, value):
r"""Sets the length in seconds of the trace range centered at the reference point.
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.000020 seconds.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the length in seconds of the trace range centered at the reference point.
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.PULSE_TRACE_RANGE_LENGTH.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_selected_burst_trace(self, selector_string):
r"""Gets the burst number selected for the display of traces. This attribute is applicable for IQ, amplitude and pulse
stability traces.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the burst number selected for the display of traces. This attribute is applicable for IQ, amplitude and pulse
stability traces.
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.PULSE_SELECTED_BURST_TRACE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_selected_burst_trace(self, selector_string, value):
r"""Sets the burst number selected for the display of traces. This attribute is applicable for IQ, amplitude and pulse
stability traces.
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.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the burst number selected for the display of traces. This attribute is applicable for IQ, amplitude and pulse
stability traces.
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.PULSE_SELECTED_BURST_TRACE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_selected_pulse_trace(self, selector_string):
r"""Gets the pulse number selected for displaying the traces. This attribute is valid only for IQ, amplitude and pulse
stability traces.
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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the pulse number selected for displaying the traces. This attribute is valid only for IQ, amplitude and pulse
stability traces.
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.PULSE_SELECTED_PULSE_TRACE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_selected_pulse_trace(self, selector_string, value):
r"""Sets the pulse number selected for displaying the traces. This attribute is valid only for IQ, amplitude and pulse
stability traces.
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.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the pulse number selected for displaying the traces. This attribute is valid only for IQ, amplitude and pulse
stability traces.
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.PULSE_SELECTED_PULSE_TRACE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
@_raise_if_disposed
def get_amplitude_trace_unit(self, selector_string):
r"""Gets the unit of the amplitude level. This attribute is applicable only for the amplitude and acquired amplitude
trace.
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 **dBm**.
+--------------+----------------------------------------+
| Name (Value) | Description |
+==============+========================================+
| dBm (0) | Amplitude trace is expressed in dBm. |
+--------------+----------------------------------------+
| Volts (1) | Amplitude trace is expressed in Volts. |
+--------------+----------------------------------------+
| Watts (2) | Amplitude trace is expressed in Watts. |
+--------------+----------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseAmplitudeTraceUnit):
Specifies the unit of the amplitude level. This attribute is applicable only for the amplitude and acquired amplitude
trace.
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.PULSE_AMPLITUDE_TRACE_UNIT.value
)
attr_val = enums.PulseAmplitudeTraceUnit(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def set_amplitude_trace_unit(self, selector_string, value):
r"""Sets the unit of the amplitude level. This attribute is applicable only for the amplitude and acquired amplitude
trace.
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 **dBm**.
+--------------+----------------------------------------+
| Name (Value) | Description |
+==============+========================================+
| dBm (0) | Amplitude trace is expressed in dBm. |
+--------------+----------------------------------------+
| Volts (1) | Amplitude trace is expressed in Volts. |
+--------------+----------------------------------------+
| Watts (2) | Amplitude trace is expressed in Watts. |
+--------------+----------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseAmplitudeTraceUnit, int):
Specifies the unit of the amplitude level. This attribute is applicable only for the amplitude and acquired amplitude
trace.
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.PulseAmplitudeTraceUnit else value
error_code = self._interpreter.set_attribute_i32(
updated_selector_string,
attributes.AttributeID.PULSE_AMPLITUDE_TRACE_UNIT.value,
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 pulse 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 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 to 10, inclusive.
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 pulse 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.PULSE_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 pulse 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 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 to 10, inclusive.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the maximum number of threads used for parallelism for the pulse 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.PULSE_NUMBER_OF_ANALYSIS_THREADS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code