"""Provides methods to fetch and read the ModAcc measurement results."""
import functools
import nirfmxcdma2k.attributes as attributes
import nirfmxcdma2k.enums as enums
import nirfmxcdma2k.errors as errors
import nirfmxcdma2k.internal._helper as _helper
def _raise_if_disposed(f):
"""From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""
@functools.wraps(f)
def aux(*xs, **kws):
meas_obj = xs[0] # parameter 0 is 'self' which is the measurement object
if meas_obj._signal_obj.is_disposed:
raise Exception("Cannot access a disposed Cdma2k signal configuration")
return f(*xs, **kws)
return aux
[docs]
class ModAccResults(object):
"""Provides methods to fetch and read the ModAcc measurement results."""
def __init__(self, signal_obj):
"""Provides methods to fetch and read the ModAcc measurement results."""
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_rms_evm(self, selector_string):
r"""Gets the RMS EVM of the composite signal. This value is expressed as a percentage.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the RMS EVM of the composite signal. This value is expressed as a percentage.
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.MODACC_RESULTS_RMS_EVM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_evm(self, selector_string):
r"""Gets the peak EVM of the composite signal. This value is expressed as a percentage.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the peak EVM of the composite signal. This value is expressed as a percentage.
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.MODACC_RESULTS_PEAK_EVM.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_rms_magnitude_error(self, selector_string):
r"""Gets the RMS magnitude error of the composite signal. This value is expressed as a percentage.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the RMS magnitude error of the composite signal. This value is expressed as a percentage.
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.MODACC_RESULTS_RMS_MAGNITUDE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_rms_phase_error(self, selector_string):
r"""Gets the RMS phase error of the composite signal. This value is expressed in degrees.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the RMS phase error of the composite signal. This value is expressed in degrees.
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.MODACC_RESULTS_RMS_PHASE_ERROR.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_rho(self, selector_string):
r"""Gets the correlation of the received signal with the reference signal normalized by the signal power. The value of
Rho is between 0 and 1.0, inclusive. A value of 1.0 indicates that the received signal and the reference signal are
perfectly correlated.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the correlation of the received signal with the reference signal normalized by the signal power. The value of
Rho is between 0 and 1.0, inclusive. A value of 1.0 indicates that the received signal and the reference signal are
perfectly correlated.
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.MODACC_RESULTS_RHO.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_iq_origin_offset(self, selector_string):
r"""Gets the I/Q origin offset of the composite signal averaged over all measured slots. This value is expressed in dB.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the I/Q origin offset of the composite signal averaged over all measured slots. This value is expressed in dB.
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.MODACC_RESULTS_IQ_ORIGIN_OFFSET.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_iq_gain_imbalance(self, selector_string):
r"""Gets the I/Q gain imbalance of the composite signal averaged over all measured slots. This value is expressed in dB.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the I/Q gain imbalance of the composite signal averaged over all measured slots. This value is expressed in dB.
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.MODACC_RESULTS_IQ_GAIN_IMBALANCE.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_iq_quadrature_error(self, selector_string):
r"""Gets the I/Q quadrature error of the composite signal, averaged over all measured slots. This value is expressed in
degrees.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the I/Q quadrature error of the composite signal, averaged over all measured slots. This value is expressed in
degrees.
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.MODACC_RESULTS_IQ_QUADRATURE_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_frequency_error(self, selector_string):
r"""Gets the frequency error averaged over all measured slots. This value is expressed in Hz.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the frequency error averaged over all measured slots. This value is expressed in Hz.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_f64(
updated_selector_string, attributes.AttributeID.MODACC_RESULTS_FREQUENCY_ERROR.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_chip_rate_error(self, selector_string):
r"""Gets the chip rate error. This value is expressed in parts per million (ppm).
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the chip rate error. This value is expressed in parts per million (ppm).
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.MODACC_RESULTS_CHIP_RATE_ERROR.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_cde(self, selector_string):
r"""Gets the maximum value among the code domain errors (CDEs). This value is expressed in dB. The CDEs are computed by
projecting the descrambled error vector onto the code domain at a specific spreading factor. The CDE for every code
with a specific spreading factor is defined as the ratio of the mean power of the projection onto that code to the mean
power of the composite reference waveform. A fixed spreading factor of 16 is used. The CDEs are computed separately for
I and Q branches.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value among the code domain errors (CDEs). This value is expressed in dB. The CDEs are computed by
projecting the descrambled error vector onto the code domain at a specific spreading factor. The CDE for every code
with a specific spreading factor is defined as the ratio of the mean power of the projection onto that code to the mean
power of the composite reference waveform. A fixed spreading factor of 16 is used. The CDEs are computed separately for
I and Q branches.
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.MODACC_RESULTS_PEAK_CDE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_cde_walsh_code_number(self, selector_string):
r"""Gets the Walsh code number corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_CDE` attribute returns.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the Walsh code number corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_CDE` attribute returns.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RESULTS_PEAK_CDE_WALSH_CODE_NUMBER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_cde_branch(self, selector_string):
r"""Gets the branch corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE` attribute returns.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
+--------------+---------------------------------------------------+
| Name (Value) | Description |
+==============+===================================================+
| I (0) | The signal is modulated on the in-phase branch. |
+--------------+---------------------------------------------------+
| Q (1) | The signal is modulated on the quadrature branch. |
+--------------+---------------------------------------------------+
| I and Q (2) | Complex modulated signal. |
+--------------+---------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccPeakCdeBranch):
Returns the branch corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE` attribute returns.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.MODACC_RESULTS_PEAK_CDE_BRANCH.value
)
attr_val = enums.ModAccPeakCdeBranch(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 get_peak_active_cde(self, selector_string):
r"""Gets the maximum value among the code domain errors (CDEs) for all active channels. This value is expressed in dB.
The active CDEs are computed by projecting the descrambled error vector onto the codes of each active channel. The
active CDE is defined as the ratio of the mean power of the projection onto that code to the mean power of the
composite reference waveform.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the maximum value among the code domain errors (CDEs) for all active channels. This value is expressed in dB.
The active CDEs are computed by projecting the descrambled error vector onto the codes of each active channel. The
active CDE is defined as the ratio of the mean power of the projection onto that code to the mean power of the
composite reference waveform.
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.MODACC_RESULTS_PEAK_ACTIVE_CDE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_active_cde_walsh_code_length(self, selector_string):
r"""Gets the Walsh code length of the channel corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE` attribute returns.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the Walsh code length of the channel corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE` attribute returns.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE_WALSH_CODE_LENGTH.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_active_cde_walsh_code_number(self, selector_string):
r"""Gets the Walsh code number of the channel corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE` attribute returns.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the Walsh code number of the channel corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE` attribute returns.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE_WALSH_CODE_NUMBER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_peak_active_cde_branch(self, selector_string):
r"""Gets the branch of the channel corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE` attribute returns.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
+--------------+---------------------------------------------------+
| Name (Value) | Description |
+==============+===================================================+
| I (0) | The signal is modulated on the in-phase branch. |
+--------------+---------------------------------------------------+
| Q (1) | The signal is modulated on the quadrature branch. |
+--------------+---------------------------------------------------+
| I and Q (2) | Complex modulated signal. |
+--------------+---------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccPeakActiveCdeBranch):
Returns the branch of the channel corresponding to the value that the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE` attribute returns.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RESULTS_PEAK_ACTIVE_CDE_BRANCH.value,
)
attr_val = enums.ModAccPeakActiveCdeBranch(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 get_slot_timing_error(self, selector_string):
r"""Gets the measured timing error from the beginning of the acquisition to the location of the first slot acquired.
This value is expressed in seconds.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the measured timing error from the beginning of the acquisition to the location of the first slot acquired.
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.MODACC_RESULTS_SLOT_TIMING_ERROR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_number_of_detected_channels(self, selector_string):
r"""Gets the total number of detected channels. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the attribute
returns the number of configured channels.
You do not need to use a selector string to read this result for the default signal and result 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 and named results.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the total number of detected channels. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the attribute
returns the number of configured channels.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RESULTS_NUMBER_OF_DETECTED_CHANNELS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_detected_walsh_code_length(self, selector_string):
r"""Gets the Walsh code length of the detected channel. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the attribute
returns the Walsh code length of the configured channel.
Use "channel<
<format type="monospace-italic">n</format>
>" as the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to read
this attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the Walsh code length of the detected channel. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the attribute
returns the Walsh code length of the configured channel.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RESULTS_DETECTED_WALSH_CODE_LENGTH.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_detected_walsh_code_number(self, selector_string):
r"""Gets the Walsh code number of the detected channel. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the attribute
returns the Walsh code number of the configured channel.
Use "channel<
<format type="monospace-italic">n</format>
>" as the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to read
this attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the Walsh code number of the detected channel. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the attribute
returns the Walsh code number of the configured channel.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string,
attributes.AttributeID.MODACC_RESULTS_DETECTED_WALSH_CODE_NUMBER.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
[docs]
@_raise_if_disposed
def get_detected_branch(self, selector_string):
r"""Gets the branch of the detected channel. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the attribute
returns the branch of the configured channel.
Use "channel<
<format type="monospace-italic">n</format>
>" as the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ to read
this attribute.
+--------------+--------------------------------------------------------------------+
| Name (Value) | Description |
+==============+====================================================================+
| I (0) | The signal modulated on the in-phase branch. |
+--------------+--------------------------------------------------------------------+
| Q (1) | The signal modulated on the quadrature branch. |
+--------------+--------------------------------------------------------------------+
| I and Q (2) | The signal modulated on the in-phase branch and quadrature branch. |
+--------------+--------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ModAccDetectedBranch):
Returns the branch of the detected channel. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the attribute
returns the branch of the configured channel.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
attr_val, error_code = self._interpreter.get_attribute_i32(
updated_selector_string, attributes.AttributeID.MODACC_RESULTS_DETECTED_BRANCH.value
)
attr_val = enums.ModAccDetectedBranch(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 fetch_detected_channel_array(self, selector_string, timeout):
r"""Returns the detected channels. If you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the
measurement returns the configured channels.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (detected_walsh_code_length, detected_walsh_code_number, detected_branch, error_code):
detected_walsh_code_length (int):
This parameter returns the array of the detected Walsh code length.
detected_walsh_code_number (int):
This parameter returns the array of the detected Walsh code number.
detected_branch (enums.ModAccDetectedBranch):
This parameter returns the array of the detected branch.
+--------------+--------------------------------------------------------------------+
| Name (value) | Description |
+==============+====================================================================+
| I (0) | The signal modulated on the in-phase branch. |
+--------------+--------------------------------------------------------------------+
| Q (1) | The signal modulated on the quadrature branch. |
+--------------+--------------------------------------------------------------------+
| I and Q (2) | The signal modulated on the in-phase branch and quadrature branch. |
+--------------+--------------------------------------------------------------------+
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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
detected_walsh_code_length, detected_walsh_code_number, detected_branch, error_code = (
self._interpreter.modacc_fetch_detected_channel_array(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return detected_walsh_code_length, detected_walsh_code_number, detected_branch, error_code
[docs]
@_raise_if_disposed
def fetch_detected_channel(self, selector_string, timeout):
r"""Returns a detected channel by its channel name.
Use "channel<n>" as the selector string to read results from this method.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name, and channel number. Examples:
"channel0"
"signal::sig1/channel0"
"result::r1/channel0"
"signal::sig1/result::r1/channel0"
You can use the :py:meth:`build_channel_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (detected_walsh_code_length, detected_walsh_code_number, detected_branch, error_code):
detected_walsh_code_length (int):
This parameter returns the detected Walsh code length.
detected_walsh_code_number (int):
This parameter returns the detected Walsh code number.
detected_branch (enums.ModAccDetectedBranch):
This parameter returns the detected branch.
+--------------+--------------------------------------------------------------------+
| Name (value) | Description |
+==============+====================================================================+
| I (0) | The signal modulated on the in-phase branch. |
+--------------+--------------------------------------------------------------------+
| Q (1) | The signal modulated on the quadrature branch. |
+--------------+--------------------------------------------------------------------+
| I and Q (2) | The signal modulated on the in-phase branch and quadrature branch. |
+--------------+--------------------------------------------------------------------+
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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
detected_walsh_code_length, detected_walsh_code_number, detected_branch, error_code = (
self._interpreter.modacc_fetch_detected_channel(updated_selector_string, timeout)
)
finally:
self._session_function_lock.exit_read_lock()
return detected_walsh_code_length, detected_walsh_code_number, detected_branch, error_code
[docs]
@_raise_if_disposed
def fetch_evm_trace(self, selector_string, timeout, evm):
r"""Returns the EVM trace of the ModAcc measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
evm (numpy.float32):
This parameter returns the real signal values stored in an array. This value is expressed as a percentage.
Returns:
Tuple (x0, dx, error_code):
x0 (float):
This parameter returns the start time. This value is expressed in seconds.
dx (float):
This parameter returns the delta parameter.
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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
x0, dx, error_code = self._interpreter.modacc_fetch_evm_trace(
updated_selector_string, timeout, evm
)
finally:
self._session_function_lock.exit_read_lock()
return x0, dx, error_code
[docs]
@_raise_if_disposed
def fetch_evm(self, selector_string, timeout):
r"""Returns the EVM value and related measurement values of the modulation accuracy (ModAcc) of the CDMA2k signal.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (rms_evm, peak_evm, rho, frequency_error, chip_rate_error, rms_magnitude_error, rms_phase_error, error_code):
rms_evm (float):
This parameter returns the RMS EVM of the composite signal. This value is expressed as a percentage.
peak_evm (float):
This parameter returns the peak value of the uplink EVM. This value is expressed as a percentage.
rho (float):
This parameter returns the correlation of the received signal with the reference signal normalized by the signal power.
frequency_error (float):
This parameter returns the chip rate error. This value is expressed in parts per million (ppm).
chip_rate_error (float):
This parameter returns the frequency error. This value is expressed in Hz.
rms_magnitude_error (float):
This parameter returns the RMS magnitude error of the composite signal. This value is expressed as a percentage.
rms_phase_error (float):
This parameter returns the RMS phase error of the composite signal. This value is expressed in degrees (deg).
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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
(
rms_evm,
peak_evm,
rho,
frequency_error,
chip_rate_error,
rms_magnitude_error,
rms_phase_error,
error_code,
) = self._interpreter.modacc_fetch_evm(updated_selector_string, timeout)
finally:
self._session_function_lock.exit_read_lock()
return (
rms_evm,
peak_evm,
rho,
frequency_error,
chip_rate_error,
rms_magnitude_error,
rms_phase_error,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_iq_impairments(self, selector_string, timeout):
r"""Returns the origin offset, gain imbalance, and quadrature error.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (iq_origin_offset, iq_gain_imbalance, iq_quadrature_error, error_code):
iq_origin_offset (float):
This parameter returns the I/Q origin offset of the composite signal. This value is expressed in dB.
iq_gain_imbalance (float):
This parameter returns the I/Q gain imbalance of the composite signal. This value is expressed in dB.
iq_quadrature_error (float):
This parameter returns the I/Q quadrature error of the composite signal. This value is expressed in degrees.
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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
iq_origin_offset, iq_gain_imbalance, iq_quadrature_error, error_code = (
self._interpreter.modacc_fetch_iq_impairments(updated_selector_string, timeout)
)
finally:
self._session_function_lock.exit_read_lock()
return iq_origin_offset, iq_gain_imbalance, iq_quadrature_error, error_code
[docs]
@_raise_if_disposed
def fetch_magnitude_error_trace(self, selector_string, timeout, magnitude_error):
r"""Returns the magnitude error trace for the modulation accuracy (ModAcc) measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
magnitude_error (numpy.float32):
This parameter returns the array of the magnitude error values. This value is expressed as a percentage.
Returns:
Tuple (x0, dx, error_code):
x0 (float):
This parameter returns the start time. This value is expressed in seconds.
dx (float):
This parameter returns the chip duration. 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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
x0, dx, error_code = self._interpreter.modacc_fetch_magnitude_error_trace(
updated_selector_string, timeout, magnitude_error
)
finally:
self._session_function_lock.exit_read_lock()
return x0, dx, error_code
[docs]
@_raise_if_disposed
def fetch_number_of_detected_channels(self, selector_string, timeout):
r"""Returns the total number of detected channels. If the you set the
:py:attr:`~nirfmxcdma2k.attributes.AttributeID.CHANNEL_CONFIGURATION_MODE` attribute to **User Defined**, the
measurement returns the number of configured channels.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (number_of_detected_channels, error_code):
number_of_detected_channels (int):
This parameter returns the total number of detected channels.
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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
number_of_detected_channels, error_code = (
self._interpreter.modacc_fetch_number_of_detected_channels(
updated_selector_string, timeout
)
)
finally:
self._session_function_lock.exit_read_lock()
return number_of_detected_channels, error_code
[docs]
@_raise_if_disposed
def fetch_peak_active_cde(self, selector_string, timeout):
r"""Returns the peak value among the code domain errors of the active channels, along with the code number and the code
length.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (peak_active_cde, peak_active_cde_walsh_code_length, peak_active_cde_walsh_code_number, peak_active_cde_branch, error_code):
peak_active_cde (float):
This parameter returns the peak value of all CDEs of the active channels. This value is expressed in dB.
peak_active_cde_walsh_code_length (int):
This parameter returns the Walsh code length of the channel corresponding to the **Peak Active CDE** value.
peak_active_cde_walsh_code_number (int):
This parameter returns the Walsh code number of the channel corresponding to the **Peak Active CDE** value.
peak_active_cde_branch (enums.ModAccPeakActiveCdeBranch):
This parameter returns the branch of the channel corresponding to the **Peak Active CDE** value.
+--------------+---------------------------------------------------+
| Name (value) | Description |
+==============+===================================================+
| I (0) | The signal is modulated on the in-phase branch. |
+--------------+---------------------------------------------------+
| Q (1) | The signal is modulated on the quadrature branch. |
+--------------+---------------------------------------------------+
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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
(
peak_active_cde,
peak_active_cde_walsh_code_length,
peak_active_cde_walsh_code_number,
peak_active_cde_branch,
error_code,
) = self._interpreter.modacc_fetch_peak_active_cde(updated_selector_string, timeout)
finally:
self._session_function_lock.exit_read_lock()
return (
peak_active_cde,
peak_active_cde_walsh_code_length,
peak_active_cde_walsh_code_number,
peak_active_cde_branch,
error_code,
)
[docs]
@_raise_if_disposed
def fetch_peak_cde(self, selector_string, timeout):
r"""Returns the maximum value among the code domain errors (CDEs), in dB.
This method calculates the CDEs by projecting the descrambled error vector onto the code domain at a specific
spreading factor.
The CDE for every code with a specific spreading factor is defined as the ratio of the mean power of the
projection onto that code to the mean power of the composite reference waveform. A fixed spreading factor of 32 is
used.
This method computes the CDEs separately for I and Q branches.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
Returns:
Tuple (peak_cde, peak_cde_walsh_code_number, peak_cde_branch, error_code):
peak_cde (float):
This parameter returns the maximum value among the code domain errors. This value is expressed in dB.
peak_cde_walsh_code_number (int):
This parameter returns the code number of the channel corresponding to the **Peak CDE** value.
peak_cde_branch (enums.ModAccPeakCdeBranch):
This parameter returns the branch of the channel corresponding to the **Peak CDE** value.
+--------------+---------------------------------------------------+
| Name (value) | Description |
+==============+===================================================+
| I (0) | The signal is modulated on the in-phase branch. |
+--------------+---------------------------------------------------+
| Q (1) | The signal is modulated on the quadrature branch. |
+--------------+---------------------------------------------------+
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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
peak_cde, peak_cde_walsh_code_number, peak_cde_branch, error_code = (
self._interpreter.modacc_fetch_peak_cde(updated_selector_string, timeout)
)
finally:
self._session_function_lock.exit_read_lock()
return peak_cde, peak_cde_walsh_code_number, peak_cde_branch, error_code
[docs]
@_raise_if_disposed
def fetch_phase_error_trace(self, selector_string, timeout, phase_error):
r"""Returns the phase error trace of the ModAcc measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
phase_error (numpy.float32):
This parameter returns the array of phase error values. This value is expressed in degrees.
Returns:
Tuple (x0, dx, error_code):
x0 (float):
This parameter returns the start time. This value is expressed in seconds.
dx (float):
This parameter returns the chip duration. 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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
x0, dx, error_code = self._interpreter.modacc_fetch_phase_error_trace(
updated_selector_string, timeout, phase_error
)
finally:
self._session_function_lock.exit_read_lock()
return x0, dx, error_code
[docs]
@_raise_if_disposed
def fetch_constellation_trace(self, selector_string, timeout, constellation):
r"""Returns the complex chips of the corrected composite signal for the modulation accuracy (ModAcc) measurement.
Args:
selector_string (string):
This parameter specifies a `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ comprising of result
name. Examples:
""
"signal::sig1"
"result::r1"
"signal::sig1/result::r1"
You can use the :py:meth:`build_result_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout for fetching the specified measurement. This value is expressed in seconds. Set
this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the
method waits until the measurement is complete. The default value is 10.
constellation (numpy.complex64):
This parameter returns the array of complex chips of the corrected signal on which the ModAcc measurements are
performed. You can use these chips to obtain the constellation diagram.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self._signal_obj
)
error_code = self._interpreter.modacc_fetch_constellation_trace(
updated_selector_string, timeout, constellation
)
finally:
self._session_function_lock.exit_read_lock()
return error_code