"""Defines a root class which is used to identify and control Vna signal configuration."""
import functools
import math
import nirfmxinstr
import nirfmxvna.attributes as attributes
import nirfmxvna.enums as enums
import nirfmxvna.errors as errors
import nirfmxvna.internal._helper as _helper
import nirfmxvna.iq as iq
import nirfmxvna.marker as marker
import nirfmxvna.s_params as s_params
import nirfmxvna.waves as waves
from nirfmxvna.internal._helper import SignalConfiguration
class _VnaSignalConfiguration:
"""Contains static methods to create and delete Vna signal."""
@staticmethod
def get_vna_signal_configuration(instr_session, signal_name="", cloning=False):
updated_signal_name = signal_name
if signal_name:
updated_signal_name = _helper.validate_and_remove_signal_qualifier(
signal_name, "signal_name"
)
_helper.validate_signal_not_empty(updated_signal_name, "signal_name")
return _VnaSignalConfiguration.init(instr_session, updated_signal_name, cloning) # type: ignore
@staticmethod
def init(instr_session, signal_name, cloning):
with instr_session._signal_lock:
if signal_name.lower() == Vna._default_signal_name_user_visible.lower():
signal_name = Vna._default_signal_name
existing_signal = instr_session._signal_manager.find_signal_configuration(
Vna._signal_configuration_type, signal_name
)
if existing_signal is None:
signal_configuration = Vna(instr_session, signal_name, cloning) # type: ignore
instr_session._signal_manager.add_signal_configuration(signal_configuration)
else:
signal_configuration = existing_signal
# Checking if signal exists in C layer
if signal_configuration._interpreter.check_if_current_signal_exists() is False:
if not signal_configuration.signal_configuration_name.lower():
instr_session._interpreter.create_default_signal_configuration(
Vna._default_signal_name_user_visible,
int(math.log(nirfmxinstr.Personalities.VNA.value, 2.0)) + 1,
)
else:
signal_configuration._interpreter.create_signal_configuration(signal_name)
return signal_configuration
@staticmethod
def remove_signal_configuration(instr_session, signal_configuration):
with instr_session._signal_lock:
instr_session._signal_manager.remove_signal_configuration(signal_configuration)
def _raise_if_disposed(f):
"""From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""
@functools.wraps(f)
def aux(*xs, **kws):
signal = xs[0] # parameter 0 is 'self' which is the signal object
if signal.is_disposed:
raise Exception("Cannot access a disposed Vna signal configuration")
return f(*xs, **kws)
return aux
class _VnaBase(SignalConfiguration):
"""Defines a base class for Vna."""
_default_signal_name = ""
_default_signal_name_user_visible = "default@VNA"
_signal_configuration_type = "<'nirfmxvna.vna.Vna'>"
def __init__(self, session, signal_name="", cloning=False):
self.is_disposed = False
self._rfmxinstrsession = session
self._rfmxinstrsession_interpreter = session._interpreter
self.signal_configuration_name = signal_name
self.signal_configuration_type = type(self) # type: ignore
self._signal_configuration_mode = "Signal"
if session._is_remote_session:
import nirfmxvna.internal._grpc_stub_interpreter as _grpc_stub_interpreter
interpreter = _grpc_stub_interpreter.GrpcStubInterpreter(session._grpc_options, session, self) # type: ignore
else:
from nirfmxvna.internal._library_interpreter import LibraryInterpreter
interpreter = LibraryInterpreter("windows-1251", session, self) # type: ignore
self._interpreter = interpreter
self._interpreter.set_session_handle(self._rfmxinstrsession_interpreter._vi) # type: ignore
self._session_function_lock = _helper.SessionFunctionLock()
# Measurements object
self.s_params = s_params.SParams(self) # type: ignore
self.waves = waves.Waves(self) # type: ignore
self.iq = iq.IQ(self) # type: ignore
self.marker = marker.Marker(self) # type: ignore
if not signal_name and not cloning:
signal_exists, personality, _ = (
self._rfmxinstrsession_interpreter.check_if_signal_exists(
self._default_signal_name_user_visible
)
)
if not (signal_exists and personality.value == nirfmxinstr.Personalities.VNA.value):
self._rfmxinstrsession_interpreter.create_default_signal_configuration(
self._default_signal_name_user_visible,
int(math.log(nirfmxinstr.Personalities.VNA.value, 2.0)) + 1,
)
elif signal_name and not cloning:
signal_exists, personality, _ = (
self._rfmxinstrsession_interpreter.check_if_signal_exists(signal_name)
)
if not (signal_exists and personality.value == nirfmxinstr.Personalities.VNA.value):
self._interpreter.create_signal_configuration(signal_name) # type: ignore
def __enter__(self):
"""Enters the context of the Vna signal configuration."""
return self
def __exit__(self, exc_type, exc_value, traceback):
"""Exits the context of the Vna signal configuration."""
self.dispose() # type: ignore
pass
def dispose(self):
r"""Deletes the signal configuration if it is not the default signal configuration
and clears any trace of the current signal configuration, if any.
.. note::
You can call this function safely more than once, even if the signal is already deleted.
"""
if not self.is_disposed:
if self.signal_configuration_name == self._default_signal_name:
self.is_disposed = True
return
else:
_ = self._delete_signal_configuration(True) # type: ignore
self.is_disposed = True
@_raise_if_disposed
def delete_signal_configuration(self):
r"""Deletes the current instance of a signal.
Returns:
error_code:
Returns the status code of this method.
The status code either indicates success or describes a warning condition.
"""
error_code = self._delete_signal_configuration(False) # type: ignore
return error_code
def _delete_signal_configuration(self, ignore_driver_error):
error_code = 0
try:
if not self.is_disposed:
self._session_function_lock.enter_write_lock()
error_code = self._interpreter.delete_signal_configuration(ignore_driver_error) # type: ignore
_VnaSignalConfiguration.remove_signal_configuration(self._rfmxinstrsession, self) # type: ignore
self.is_disposed = True
finally:
self._session_function_lock.exit_write_lock()
return error_code
@_raise_if_disposed
def get_warning(self):
r"""Retrieves and then clears the warning information for the session.
Returns:
Tuple (warning_code, warning_message):
warning_code (int):
Contains the latest warning code.
warning_message (string):
Contains the latest warning description.
"""
try:
self._session_function_lock.enter_read_lock()
warning_code, warning_message = self._interpreter.get_error() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return warning_code, warning_message
@_raise_if_disposed
def get_error_string(self, error_code):
r"""Gets the description of a driver error code.
Args:
error_code (int):
Specifies an error or warning code.
Returns:
string:
Contains the error description.
"""
try:
self._session_function_lock.enter_read_lock()
error_message = self._interpreter.get_error_string(error_code) # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return error_message
@_raise_if_disposed
def reset_attribute(self, selector_string, attribute_id):
r"""Resets the attribute to its default value.
Args:
selector_string (string):
Specifies the selector string for the property being reset.
attribute_id (PropertyId):
Specifies an attribute identifier.
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
)
attribute_id = (
attribute_id.value if type(attribute_id) is attributes.AttributeID else attribute_id
)
error_code = self._interpreter.reset_attribute( # type: ignore
updated_selector_string, attribute_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_trigger_type(self, selector_string):
r"""Gets the trigger type.
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) | No trigger is configured. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
| Digital Edge (1) | The trigger is asserted when a digital edge is detected. You can specify the source of the digital edge using the |
| | Digital Edge Source attribute. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
| Software (2) | The trigger is asserted when you send a software trigger. Use |
| | RFmxVNA Send Software Edge Trigger method to send a software trigger. RFmx ignores Software Edge Trigger when |
| | performing Calibration. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.TriggerType):
Specifies the trigger type.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.TRIGGER_TYPE.value
)
attr_val = enums.TriggerType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_trigger_type(self, selector_string, value):
r"""Sets the trigger type.
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) | No trigger is configured. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
| Digital Edge (1) | The trigger is asserted when a digital edge is detected. You can specify the source of the digital edge using the |
| | Digital Edge Source attribute. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
| Software (2) | The trigger is asserted when you send a software trigger. Use |
| | RFmxVNA Send Software Edge Trigger method to send a software trigger. RFmx ignores Software Edge Trigger when |
| | performing Calibration. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.TriggerType, int):
Specifies the trigger type.
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
)
value = value.value if type(value) is enums.TriggerType else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.TRIGGER_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_digital_edge_trigger_source(self, selector_string):
r"""Gets the terminal name used as the source for asserting a digital edge trigger. This attribute is used only when
you set the :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` attribute to **Digital 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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the terminal name used as the source for asserting a digital edge trigger. This attribute is used only when
you set the :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` attribute to **Digital 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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string, attributes.AttributeID.DIGITAL_EDGE_TRIGGER_SOURCE.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_digital_edge_trigger_source(self, selector_string, value):
r"""Sets the terminal name used as the source for asserting a digital edge trigger. This attribute is used only when
you set the :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` attribute to **Digital 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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the terminal name used as the source for asserting a digital edge trigger. This attribute is used only when
you set the :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` attribute to **Digital 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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.DIGITAL_EDGE_TRIGGER_SOURCE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_digital_edge_trigger_edge(self, selector_string):
r"""Gets the edge of the digital-signal used to assert a digital edge trigger. This attribute is used only when you
set the :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` attribute to **Digital 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 **Rising Edge**.
+------------------+----------------------------------------------------------------+
| Name (Value) | Description |
+==================+================================================================+
| Rising Edge (0) | The trigger asserts on the rising edge of the digital-signal. |
+------------------+----------------------------------------------------------------+
| Falling Edge (1) | The trigger asserts on the falling edge of the digital-signal. |
+------------------+----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.DigitalEdgeTriggerEdge):
Specifies the edge of the digital-signal used to assert a digital edge trigger. This attribute is used only when you
set the :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` attribute to **Digital 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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.DIGITAL_EDGE_TRIGGER_EDGE.value
)
attr_val = enums.DigitalEdgeTriggerEdge(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_digital_edge_trigger_edge(self, selector_string, value):
r"""Sets the edge of the digital-signal used to assert a digital edge trigger. This attribute is used only when you
set the :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` attribute to **Digital 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 **Rising Edge**.
+------------------+----------------------------------------------------------------+
| Name (Value) | Description |
+==================+================================================================+
| Rising Edge (0) | The trigger asserts on the rising edge of the digital-signal. |
+------------------+----------------------------------------------------------------+
| Falling Edge (1) | The trigger asserts on the falling edge of the digital-signal. |
+------------------+----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.DigitalEdgeTriggerEdge, int):
Specifies the edge of the digital-signal used to assert a digital edge trigger. This attribute is used only when you
set the :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` attribute to **Digital 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
)
value = value.value if type(value) is enums.DigitalEdgeTriggerEdge else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.DIGITAL_EDGE_TRIGGER_EDGE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_trigger_mode(self, selector_string):
r"""Gets the trigger mode. Trigger Mode decides how many data points are acquired for each asserted trigger.
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 **Signal**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Signal (0) | VNA waits for asserting only one instance of trigger before acquiring all data points for the configured measurements |
| | in the RFmxVNA Signal namespace. You can specify the RFmxVNA Signal name using Selector Strings attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Sweep (1) | All data points that share a source port are acquired after VNA asserts one instance of the trigger. |
| | For example, when you |
| | measure S11 and S22 at 10 frequency points using a 2-port VNA, after asserting the first instance of trigger, the |
| | device completes all acquisitions that require VNA port 1 as source. Upon asserting the second trigger, the device |
| | completes all acquisitions that require VNA port 2 as source. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Point (2) | VNA acquires only one data point for each trigger instance that it asserts. |
| | For example, when you |
| | measure S11 and S22 at 10 frequency points using a 2-port VNA, the device will assert a total of 20 trigger instances |
| | to complete all acquisitions. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Segment (3) | When Sweep Type attribute is set to Segment, all data points within a segment that share a source port are acquired |
| | after VNA asserts one instance of the trigger. |
| | For example, when measuring S11 and S22 using a 2-port VNA across 2 frequency segments, each containing 4 frequency |
| | points, after the first trigger is asserted, the device completes all acquisitions in the first segment that require |
| | VNA port 1 as source. Upon asserting the second trigger, the device completes all acquisitions in the second segment |
| | that require VNA port 1 as source. On the third trigger, the device completes all acquisitions in the first segment |
| | that require VNA port 2 as source. On the fourth trigger, the device completes all acquisitions in the second segment |
| | that require VNA port 2 as source. Therefore, a total of 4 triggers are required to complete all acquisitions of both |
| | segments for both source ports. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.TriggerMode):
Specifies the trigger mode. Trigger Mode decides how many data points are acquired for each asserted trigger.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.TRIGGER_MODE.value
)
attr_val = enums.TriggerMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_trigger_mode(self, selector_string, value):
r"""Sets the trigger mode. Trigger Mode decides how many data points are acquired for each asserted trigger.
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 **Signal**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Signal (0) | VNA waits for asserting only one instance of trigger before acquiring all data points for the configured measurements |
| | in the RFmxVNA Signal namespace. You can specify the RFmxVNA Signal name using Selector Strings attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Sweep (1) | All data points that share a source port are acquired after VNA asserts one instance of the trigger. |
| | For example, when you |
| | measure S11 and S22 at 10 frequency points using a 2-port VNA, after asserting the first instance of trigger, the |
| | device completes all acquisitions that require VNA port 1 as source. Upon asserting the second trigger, the device |
| | completes all acquisitions that require VNA port 2 as source. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Point (2) | VNA acquires only one data point for each trigger instance that it asserts. |
| | For example, when you |
| | measure S11 and S22 at 10 frequency points using a 2-port VNA, the device will assert a total of 20 trigger instances |
| | to complete all acquisitions. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Segment (3) | When Sweep Type attribute is set to Segment, all data points within a segment that share a source port are acquired |
| | after VNA asserts one instance of the trigger. |
| | For example, when measuring S11 and S22 using a 2-port VNA across 2 frequency segments, each containing 4 frequency |
| | points, after the first trigger is asserted, the device completes all acquisitions in the first segment that require |
| | VNA port 1 as source. Upon asserting the second trigger, the device completes all acquisitions in the second segment |
| | that require VNA port 1 as source. On the third trigger, the device completes all acquisitions in the first segment |
| | that require VNA port 2 as source. On the fourth trigger, the device completes all acquisitions in the second segment |
| | that require VNA port 2 as source. Therefore, a total of 4 triggers are required to complete all acquisitions of both |
| | segments for both source ports. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.TriggerMode, int):
Specifies the trigger mode. Trigger Mode decides how many data points are acquired for each asserted trigger.
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
)
value = value.value if type(value) is enums.TriggerMode else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.TRIGGER_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_trigger_delay(self, selector_string):
r"""Gets the delay between the instance when the analyzer receives a trigger and the instance when it starts
acquiring.
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 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the delay between the instance when the analyzer receives a trigger and the instance when it starts
acquiring.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.TRIGGER_DELAY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_trigger_delay(self, selector_string, value):
r"""Sets the delay between the instance when the analyzer receives a trigger and the instance when it starts
acquiring.
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 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the delay between the instance when the analyzer receives a trigger and the instance when it starts
acquiring.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.TRIGGER_DELAY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_ready_for_trigger_event_output_terminal(self, selector_string):
r"""Gets the destination terminal name for the Ready For Trigger event. This event indicates to an external device
responsible for sending triggers that the VNA is ready to receive the trigger. Use
:py:attr:`~nirfmxvna.attributes.AttributeID.READY_FOR_TRIGGER_EVENT_LEVEL` to define the polarity.
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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the destination terminal name for the Ready For Trigger event. This event indicates to an external device
responsible for sending triggers that the VNA is ready to receive the trigger. Use
:py:attr:`~nirfmxvna.attributes.AttributeID.READY_FOR_TRIGGER_EVENT_LEVEL` to define the polarity.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.READY_FOR_TRIGGER_EVENT_OUTPUT_TERMINAL.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_ready_for_trigger_event_output_terminal(self, selector_string, value):
r"""Sets the destination terminal name for the Ready For Trigger event. This event indicates to an external device
responsible for sending triggers that the VNA is ready to receive the trigger. Use
:py:attr:`~nirfmxvna.attributes.AttributeID.READY_FOR_TRIGGER_EVENT_LEVEL` to define the polarity.
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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the destination terminal name for the Ready For Trigger event. This event indicates to an external device
responsible for sending triggers that the VNA is ready to receive the trigger. Use
:py:attr:`~nirfmxvna.attributes.AttributeID.READY_FOR_TRIGGER_EVENT_LEVEL` to define the polarity.
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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.READY_FOR_TRIGGER_EVENT_OUTPUT_TERMINAL.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_ready_for_trigger_event_terminal_name(self, selector_string):
r"""Gets the fully qualified signal name as string.
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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Returns the fully qualified signal name as string.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.READY_FOR_TRIGGER_EVENT_TERMINAL_NAME.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def get_ready_for_trigger_event_level(self, selector_string):
r"""Gets the trigger level for the Ready For Trigger event. This event indicates to an external device responsible for
sending triggers that the VNA is ready to receive the trigger.
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 **Active Low**.
The :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` you configure determines the number of triggers
needed for the VNA to complete the measurement. It also affects how often the **ready for trigger** event changes
polarity. For example, when measuring S11 and S22 using a 2-port VNA with
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` set to **Digital** or **Software**, and the **ready for
trigger** event polarity set to **Active Low**, the polarity behavior for various
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` will be as follows:
1.
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` is **Signal**: the VNA waits for only one instance
of the trigger to be asserted before acquiring all data points. When VNA is ready to receive the trigger, the ready
event polarity is LOW and switches to HIGH after a trigger is asserted.
2.
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` is **Sweep**: the VNA waits for one instance of the
trigger to be asserted before acquiring all data points that share a source port. When VNA is ready to receive the
first trigger, the ready event polarity is LOW and switches to HIGH after the first trigger is asserted. The polarity
remains HIGH until VNA completes all the acquisitions that require VNA port 1 as the source. When VNA is ready to
receive the second trigger, the ready event polarity switches to LOW. Upon assertion of the second trigger, the
polarity switches to HIGH.
3.
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` is **Point**: the VNA waits for one instance of the
trigger to be asserted before acquiring each data point. When VNA is ready to acquire a data point, the ready event
polarity is LOW, and switches to HIGH after a trigger is asserted. The polarity remains HIGH until VNA is ready to
acquire the next data point.
4.
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` is **Segment** with segmented sweep across two
frequency segments: the VNA waits for one instance of the trigger to be asserted before acquiring all data points
within a segment that share a source port. When VNA is ready to receive the first trigger, the ready event polarity is
LOW and switches to HIGH after the first trigger is asserted. The polarity remains HIGH until the VNA completes all the
acquisitions for the first segment that require VNA port 1 as the source, and until the VNA is ready to receive the
second trigger. When VNA is ready to receive the second trigger, the ready event polarity switches to LOW. Upon
assertion of the second trigger, the polarity switches to HIGH. The polarity remains HIGH until VNA completes all the
acquisitions for the second segment that require VNA port 1 as the source. The VNA is then ready to receive the second
trigger, at which point the ready event polarity switches to LOW. Upon assertion of the second trigger, the polarity
switches to HIGH and remains HIGH until the VNA completes all acquisitions for the second segment that require VNA port
1 as the source. The ready event polarity follows the same behavior for the third and fourth trigger instances, which
are required to complete all acquisitions for the first and second segments that require VNA port 2 as the source,
respectively.
+-----------------+----------------------------------------------------------------+
| Name (Value) | Description |
+=================+================================================================+
| Active High (0) | Event level is HIGH when analyzer is ready to receive trigger. |
+-----------------+----------------------------------------------------------------+
| Active Low (1) | Event level is LOW when analyzer is ready to receive trigger. |
+-----------------+----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.ReadyForTriggerEventLevel):
Specifies the trigger level for the Ready For Trigger event. This event indicates to an external device responsible for
sending triggers that the VNA is ready to receive the trigger.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.READY_FOR_TRIGGER_EVENT_LEVEL.value
)
attr_val = enums.ReadyForTriggerEventLevel(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_ready_for_trigger_event_level(self, selector_string, value):
r"""Sets the trigger level for the Ready For Trigger event. This event indicates to an external device responsible for
sending triggers that the VNA is ready to receive the trigger.
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 **Active Low**.
The :py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` you configure determines the number of triggers
needed for the VNA to complete the measurement. It also affects how often the **ready for trigger** event changes
polarity. For example, when measuring S11 and S22 using a 2-port VNA with
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_TYPE` set to **Digital** or **Software**, and the **ready for
trigger** event polarity set to **Active Low**, the polarity behavior for various
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` will be as follows:
1.
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` is **Signal**: the VNA waits for only one instance
of the trigger to be asserted before acquiring all data points. When VNA is ready to receive the trigger, the ready
event polarity is LOW and switches to HIGH after a trigger is asserted.
2.
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` is **Sweep**: the VNA waits for one instance of the
trigger to be asserted before acquiring all data points that share a source port. When VNA is ready to receive the
first trigger, the ready event polarity is LOW and switches to HIGH after the first trigger is asserted. The polarity
remains HIGH until VNA completes all the acquisitions that require VNA port 1 as the source. When VNA is ready to
receive the second trigger, the ready event polarity switches to LOW. Upon assertion of the second trigger, the
polarity switches to HIGH.
3.
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` is **Point**: the VNA waits for one instance of the
trigger to be asserted before acquiring each data point. When VNA is ready to acquire a data point, the ready event
polarity is LOW, and switches to HIGH after a trigger is asserted. The polarity remains HIGH until VNA is ready to
acquire the next data point.
4.
:py:attr:`~nirfmxvna.attributes.AttributeID.TRIGGER_MODE` is **Segment** with segmented sweep across two
frequency segments: the VNA waits for one instance of the trigger to be asserted before acquiring all data points
within a segment that share a source port. When VNA is ready to receive the first trigger, the ready event polarity is
LOW and switches to HIGH after the first trigger is asserted. The polarity remains HIGH until the VNA completes all the
acquisitions for the first segment that require VNA port 1 as the source, and until the VNA is ready to receive the
second trigger. When VNA is ready to receive the second trigger, the ready event polarity switches to LOW. Upon
assertion of the second trigger, the polarity switches to HIGH. The polarity remains HIGH until VNA completes all the
acquisitions for the second segment that require VNA port 1 as the source. The VNA is then ready to receive the second
trigger, at which point the ready event polarity switches to LOW. Upon assertion of the second trigger, the polarity
switches to HIGH and remains HIGH until the VNA completes all acquisitions for the second segment that require VNA port
1 as the source. The ready event polarity follows the same behavior for the third and fourth trigger instances, which
are required to complete all acquisitions for the first and second segments that require VNA port 2 as the source,
respectively.
+-----------------+----------------------------------------------------------------+
| Name (Value) | Description |
+=================+================================================================+
| Active High (0) | Event level is HIGH when analyzer is ready to receive trigger. |
+-----------------+----------------------------------------------------------------+
| Active Low (1) | Event level is LOW when analyzer is ready to receive trigger. |
+-----------------+----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.ReadyForTriggerEventLevel, int):
Specifies the trigger level for the Ready For Trigger event. This event indicates to an external device responsible for
sending triggers that the VNA is ready to receive the trigger.
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
)
value = value.value if type(value) is enums.ReadyForTriggerEventLevel else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.READY_FOR_TRIGGER_EVENT_LEVEL.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_index_event_output_terminal(self, selector_string):
r"""Gets the destination terminal name for the Index event. This event indicates that the analyzer has completed all
acquisitions for the signal. Use :py:attr:`~nirfmxvna.attributes.AttributeID.INDEX_EVENT_LEVEL` to define the polarity.
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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the destination terminal name for the Index event. This event indicates that the analyzer has completed all
acquisitions for the signal. Use :py:attr:`~nirfmxvna.attributes.AttributeID.INDEX_EVENT_LEVEL` to define the polarity.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string, attributes.AttributeID.INDEX_EVENT_OUTPUT_TERMINAL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_index_event_output_terminal(self, selector_string, value):
r"""Sets the destination terminal name for the Index event. This event indicates that the analyzer has completed all
acquisitions for the signal. Use :py:attr:`~nirfmxvna.attributes.AttributeID.INDEX_EVENT_LEVEL` to define the polarity.
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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the destination terminal name for the Index event. This event indicates that the analyzer has completed all
acquisitions for the signal. Use :py:attr:`~nirfmxvna.attributes.AttributeID.INDEX_EVENT_LEVEL` to define the polarity.
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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.INDEX_EVENT_OUTPUT_TERMINAL.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_index_event_terminal_name(self, selector_string):
r"""Gets the fully qualified signal name as string.
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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Returns the fully qualified signal name as string.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string, attributes.AttributeID.INDEX_EVENT_TERMINAL_NAME.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def get_index_event_level(self, selector_string):
r"""Gets the trigger level for the Index event. This event indicates that the analyzer has completed all acquisitions
for the signal.
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 **Active Low**.
For example, when measuring S-Parameters for a DUT with event polarity set to **Active Low**, the index event
polarity remains HIGH until VNA completes all the acquisitions for the DUT and then switches to LOW.
+-----------------+--------------------------------------------------------------------------------------+
| Name (Value) | Description |
+=================+======================================================================================+
| Active High (0) | Event level is HIGH when analyzer has completed all the acquisitions for the signal. |
+-----------------+--------------------------------------------------------------------------------------+
| Active Low (1) | Event level is LOW when analyzer has completed all the acquisitions for the signal. |
+-----------------+--------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.IndexEventLevel):
Specifies the trigger level for the Index event. This event indicates that the analyzer has completed all acquisitions
for the signal.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.INDEX_EVENT_LEVEL.value
)
attr_val = enums.IndexEventLevel(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_index_event_level(self, selector_string, value):
r"""Sets the trigger level for the Index event. This event indicates that the analyzer has completed all acquisitions
for the signal.
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 **Active Low**.
For example, when measuring S-Parameters for a DUT with event polarity set to **Active Low**, the index event
polarity remains HIGH until VNA completes all the acquisitions for the DUT and then switches to LOW.
+-----------------+--------------------------------------------------------------------------------------+
| Name (Value) | Description |
+=================+======================================================================================+
| Active High (0) | Event level is HIGH when analyzer has completed all the acquisitions for the signal. |
+-----------------+--------------------------------------------------------------------------------------+
| Active Low (1) | Event level is LOW when analyzer has completed all the acquisitions for the signal. |
+-----------------+--------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.IndexEventLevel, int):
Specifies the trigger level for the Index event. This event indicates that the analyzer has completed all acquisitions
for the signal.
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
)
value = value.value if type(value) is enums.IndexEventLevel else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.INDEX_EVENT_LEVEL.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_sweep_type(self, selector_string):
r"""Gets the sweep type for the 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 **List**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| List (0) | The frequency is swept in arbitrary frequency steps. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Linear (1) | The frequency is swept in equidistant steps over the frequency range. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Segment (2) | The frequency is swept in frequency sub-sweeps, called segments. |
| | For each segment, you can define independent values for settings like IF bandwidth, dwell time, source power level and |
| | test receiver attenuation. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| CW Time (4) | The sweep is performed repeatedly on a single frequency and the measurement results are displayed versus time. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SweepType):
Specifies the sweep type for the 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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SWEEP_TYPE.value
)
attr_val = enums.SweepType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_sweep_type(self, selector_string, value):
r"""Sets the sweep type for the 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 **List**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| List (0) | The frequency is swept in arbitrary frequency steps. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Linear (1) | The frequency is swept in equidistant steps over the frequency range. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Segment (2) | The frequency is swept in frequency sub-sweeps, called segments. |
| | For each segment, you can define independent values for settings like IF bandwidth, dwell time, source power level and |
| | test receiver attenuation. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| CW Time (4) | The sweep is performed repeatedly on a single frequency and the measurement results are displayed versus time. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.SweepType, int):
Specifies the sweep type for the 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
)
value = value.value if type(value) is enums.SweepType else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SWEEP_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_frequency_list(self, selector_string):
r"""Gets the frequency values for the configured measurements. The frequencies must be in ascending order and must not
contain duplicates. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **List**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is an empty array.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency values for the configured measurements. The frequencies must be in ascending order and must not
contain duplicates. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **List**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64_array( # type: ignore
updated_selector_string, attributes.AttributeID.FREQUENCY_LIST.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_frequency_list(self, selector_string, value):
r"""Sets the frequency values for the configured measurements. The frequencies must be in ascending order and must not
contain duplicates. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **List**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is an empty array.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency values for the configured measurements. The frequencies must be in ascending order and must not
contain duplicates. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **List**. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64_array( # type: ignore
updated_selector_string, attributes.AttributeID.FREQUENCY_LIST.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_start_frequency(self, selector_string):
r"""Gets the lowest frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 1 GHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the lowest frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.START_FREQUENCY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_start_frequency(self, selector_string, value):
r"""Sets the lowest frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 1 GHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the lowest frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear**. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.START_FREQUENCY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_stop_frequency(self, selector_string):
r"""Gets the highest frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 2 GHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the highest frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.STOP_FREQUENCY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_stop_frequency(self, selector_string, value):
r"""Sets the highest frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 2 GHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the highest frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear**. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.STOP_FREQUENCY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_cw_frequency(self, selector_string):
r"""Gets the frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **CW Time**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 1 GHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **CW Time**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.CW_FREQUENCY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_cw_frequency(self, selector_string, value):
r"""Sets the frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **CW Time**. This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 1 GHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **CW Time**. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.CW_FREQUENCY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_number_of_points(self, selector_string):
r"""Gets the number of points at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear** or **CW Time**.
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 201.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of points at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear** or **CW Time**.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.NUMBER_OF_POINTS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_number_of_points(self, selector_string, value):
r"""Sets the number of points at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear** or **CW Time**.
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 201.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of points at which measurements are performed. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Linear** or **CW Time**.
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
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.NUMBER_OF_POINTS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_power_level(self, selector_string):
r"""Gets the power level for the VNA source port. This value is expressed in dBm.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same power level for all VNA ports.
The default value is -10 dBm.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the power level for the VNA source port. This value is expressed in dBm.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.POWER_LEVEL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_power_level(self, selector_string, value):
r"""Sets the power level for the VNA source port. This value is expressed in dBm.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same power level for all VNA ports.
The default value is -10 dBm.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the power level for the VNA source port. This value is expressed in dBm.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.POWER_LEVEL.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_test_receiver_attenuation(self, selector_string):
r"""Gets the attenuation that the VNA uses to attenuate the RF signal before it reaches the downconverting mixer on
the path towards the Test Receiver. The receiver that measures the scattered waves traveling away from the DUT port and
towards the VNA port is referred to as the Test Receiver. This value is expressed in dB.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same test receiver attenuation for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the attenuation that the VNA uses to attenuate the RF signal before it reaches the downconverting mixer on
the path towards the Test Receiver. The receiver that measures the scattered waves traveling away from the DUT port and
towards the VNA port is referred to as the Test Receiver. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.TEST_RECEIVER_ATTENUATION.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_test_receiver_attenuation(self, selector_string, value):
r"""Sets the attenuation that the VNA uses to attenuate the RF signal before it reaches the downconverting mixer on
the path towards the Test Receiver. The receiver that measures the scattered waves traveling away from the DUT port and
towards the VNA port is referred to as the Test Receiver. This value is expressed in dB.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same test receiver attenuation for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the attenuation that the VNA uses to attenuate the RF signal before it reaches the downconverting mixer on
the path towards the Test Receiver. The receiver that measures the scattered waves traveling away from the DUT port and
towards the VNA port is referred to as the Test Receiver. This value is expressed in dB.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.TEST_RECEIVER_ATTENUATION.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_if_bandwidth(self, selector_string):
r"""Gets the digital IF filter bandwidth. This value is expressed in Hz.
NI PXIe-5633 supports the following IF Bandwidths: 1, 2, 3, 5, 7, 10, 20, 30, 50, 70, 100, 200, 300, 500, 700,
1k, 2k, 3k, 5k, 7k, 10k, 20k, 30k, 50k, 70k, 100k, 200k, 300k, 500k, 700k, 1M, 2M, 3M, 5M, 7M, 10M, 15M. If you set IF
Bandwidth to an unsupported value, RFmx automatically coerces to the smallest supported IF Bandwidth greater than or
equal to the value you set. If you set IF Bandwidth to a value higher than the maximum supported value, RFmx
automatically coerces it to maximum supported IF Bandwidth.
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 100 kHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the digital IF filter bandwidth. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.IF_BANDWIDTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_if_bandwidth(self, selector_string, value):
r"""Sets the digital IF filter bandwidth. This value is expressed in Hz.
NI PXIe-5633 supports the following IF Bandwidths: 1, 2, 3, 5, 7, 10, 20, 30, 50, 70, 100, 200, 300, 500, 700,
1k, 2k, 3k, 5k, 7k, 10k, 20k, 30k, 50k, 70k, 100k, 200k, 300k, 500k, 700k, 1M, 2M, 3M, 5M, 7M, 10M, 15M. If you set IF
Bandwidth to an unsupported value, RFmx automatically coerces to the smallest supported IF Bandwidth greater than or
equal to the value you set. If you set IF Bandwidth to a value higher than the maximum supported value, RFmx
automatically coerces it to maximum supported IF Bandwidth.
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 100 kHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the digital IF filter bandwidth. This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.IF_BANDWIDTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_auto_if_bandwidth_scaling_enabled(self, selector_string):
r"""Gets whether IF Bandwidth is automatically scaled down to account for the increased VNA receiver noise at low
frequencies. This attribute will automatically set to **False** when
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute is set to **True**.
Consider disabling automatic IF Bandwidth scaling by setting this attribute to False if you want faster
measurement speed but with higher measurment noise at low frequencies.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+-------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+===================================================================================================================+
| False (0) | Disables automatic IF Bandwidth scaling that compensates for the increased VNA receiver noise at low frequencies. |
+--------------+-------------------------------------------------------------------------------------------------------------------+
| True (1) | Enables automatic IF Bandwidth scaling that compensates for the increased VNA receiver noise at low frequencies. |
+--------------+-------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AutoIFBandwidthScalingEnabled):
Specifies whether IF Bandwidth is automatically scaled down to account for the increased VNA receiver noise at low
frequencies. This attribute will automatically set to **False** when
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute is 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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.AUTO_IF_BANDWIDTH_SCALING_ENABLED.value,
)
attr_val = enums.AutoIFBandwidthScalingEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_auto_if_bandwidth_scaling_enabled(self, selector_string, value):
r"""Sets whether IF Bandwidth is automatically scaled down to account for the increased VNA receiver noise at low
frequencies. This attribute will automatically set to **False** when
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute is set to **True**.
Consider disabling automatic IF Bandwidth scaling by setting this attribute to False if you want faster
measurement speed but with higher measurment noise at low frequencies.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **True**.
+--------------+-------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+===================================================================================================================+
| False (0) | Disables automatic IF Bandwidth scaling that compensates for the increased VNA receiver noise at low frequencies. |
+--------------+-------------------------------------------------------------------------------------------------------------------+
| True (1) | Enables automatic IF Bandwidth scaling that compensates for the increased VNA receiver noise at low frequencies. |
+--------------+-------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AutoIFBandwidthScalingEnabled, int):
Specifies whether IF Bandwidth is automatically scaled down to account for the increased VNA receiver noise at low
frequencies. This attribute will automatically set to **False** when
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute is 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
)
value = value.value if type(value) is enums.AutoIFBandwidthScalingEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.AUTO_IF_BANDWIDTH_SCALING_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_sweep_sequence(self, selector_string):
r"""Gets the sequence of acquisitions for various frequency points and source ports.
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 **Standard**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Standard (0) | Acquisitions for all frequency points are completed with the first source port before moving to the next source port. |
| | For example, if there are three frequency points f1, f2 and f3 and two source ports, port1 and port2, then the sweep |
| | sequence will be (f1, port1), (f2, port1), (f3, port1), (f1, port2), (f2, port2), (f3, port2). |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Point (1) | All acquisitions for a frequency point are completed with all required source ports, before moving to the next |
| | frequency point. For example, if there are three frequency points f1, f2 and f3 and two source ports, port1 and port2, |
| | then the sweep sequence will be (f1, port1), (f1, port2), (f2, port1), (f2, port2), (f3, port1), (f3, port2). |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SweepSequence):
Specifies the sequence of acquisitions for various frequency points and source ports.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SWEEP_SEQUENCE.value
)
attr_val = enums.SweepSequence(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_sweep_sequence(self, selector_string, value):
r"""Sets the sequence of acquisitions for various frequency points and source ports.
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 **Standard**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| Standard (0) | Acquisitions for all frequency points are completed with the first source port before moving to the next source port. |
| | For example, if there are three frequency points f1, f2 and f3 and two source ports, port1 and port2, then the sweep |
| | sequence will be (f1, port1), (f2, port1), (f3, port1), (f1, port2), (f2, port2), (f3, port2). |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Point (1) | All acquisitions for a frequency point are completed with all required source ports, before moving to the next |
| | frequency point. For example, if there are three frequency points f1, f2 and f3 and two source ports, port1 and port2, |
| | then the sweep sequence will be (f1, port1), (f1, port2), (f2, port1), (f2, port2), (f3, port1), (f3, port2). |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.SweepSequence, int):
Specifies the sequence of acquisitions for various frequency points and source ports.
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
)
value = value.value if type(value) is enums.SweepSequence else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SWEEP_SEQUENCE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_sweep_delay(self, selector_string):
r"""Gets the time for which VNA waits before it starts acquiring data for each sweep. Total delay for acquiring the
first point in each sweep is sum of this delay and :py:attr:`~nirfmxvna.attributes.AttributeID.DWELL_TIME`. 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 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the time for which VNA waits before it starts acquiring data for each sweep. Total delay for acquiring the
first point in each sweep is sum of this delay and :py:attr:`~nirfmxvna.attributes.AttributeID.DWELL_TIME`. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SWEEP_DELAY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_sweep_delay(self, selector_string, value):
r"""Sets the time for which VNA waits before it starts acquiring data for each sweep. Total delay for acquiring the
first point in each sweep is sum of this delay and :py:attr:`~nirfmxvna.attributes.AttributeID.DWELL_TIME`. 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 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the time for which VNA waits before it starts acquiring data for each sweep. Total delay for acquiring the
first point in each sweep is sum of this delay and :py:attr:`~nirfmxvna.attributes.AttributeID.DWELL_TIME`. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SWEEP_DELAY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_dwell_time(self, selector_string):
r"""Gets the time for which the analyzer waits before acquiring the signal for each measurement point. Use dwell time
when measuring devices with substantial electrical lengths, requiring compensation for the delay between frequency
changes at the generator and their observation at the analyzer. 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 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the time for which the analyzer waits before acquiring the signal for each measurement point. Use dwell time
when measuring devices with substantial electrical lengths, requiring compensation for the delay between frequency
changes at the generator and their observation at the analyzer. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.DWELL_TIME.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_dwell_time(self, selector_string, value):
r"""Sets the time for which the analyzer waits before acquiring the signal for each measurement point. Use dwell time
when measuring devices with substantial electrical lengths, requiring compensation for the delay between frequency
changes at the generator and their observation at the analyzer. 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 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the time for which the analyzer waits before acquiring the signal for each measurement point. Use dwell time
when measuring devices with substantial electrical lengths, requiring compensation for the delay between frequency
changes at the generator and their observation at the analyzer. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.DWELL_TIME.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_number_of_segments(self, selector_string):
r"""Gets the number of sweep segments. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**
If you increase this attribute value from N to N+K, then existing N segments are not affected but K new
segments are added. If you reduce number of segments from N to N-K, then last K segments are deleted without affecting
the remaining N-K segments.
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 number of sweep segments. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.NUMBER_OF_SEGMENTS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_number_of_segments(self, selector_string, value):
r"""Sets the number of sweep segments. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**
If you increase this attribute value from N to N+K, then existing N segments are not affected but K new
segments are added. If you reduce number of segments from N to N-K, then last K segments are deleted without affecting
the remaining N-K segments.
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 number of sweep segments. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**
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
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.NUMBER_OF_SEGMENTS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_enabled(self, selector_string):
r"""Gets whether to enable the selected segment for the sweep. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment.
The default value is **False**.
+--------------+--------------------------------+
| Name (Value) | Description |
+==============+================================+
| False (0) | Disables the selected segment. |
+--------------+--------------------------------+
| True (1) | Enables the selected segment. |
+--------------+--------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SegmentEnabled):
Specifies whether to enable the selected segment for the sweep. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_ENABLED.value
)
attr_val = enums.SegmentEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_enabled(self, selector_string, value):
r"""Sets whether to enable the selected segment for the sweep. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment.
The default value is **False**.
+--------------+--------------------------------+
| Name (Value) | Description |
+==============+================================+
| False (0) | Disables the selected segment. |
+--------------+--------------------------------+
| True (1) | Enables the selected segment. |
+--------------+--------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.SegmentEnabled, int):
Specifies whether to enable the selected segment for the sweep. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**
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
)
value = value.value if type(value) is enums.SegmentEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_start_frequency(self, selector_string):
r"""Gets the lowest frequency of the selected segment at which measurements are performed. This attribute is used only
when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**. This value is
expressed in Hz.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment.
The default value is 1 GHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the lowest frequency of the selected segment at which measurements are performed. This attribute is used only
when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_START_FREQUENCY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_start_frequency(self, selector_string, value):
r"""Sets the lowest frequency of the selected segment at which measurements are performed. This attribute is used only
when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**. This value is
expressed in Hz.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment.
The default value is 1 GHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the lowest frequency of the selected segment at which measurements are performed. This attribute is used only
when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**. This value is
expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_START_FREQUENCY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_stop_frequency(self, selector_string):
r"""Gets the highest frequency of the selected segment at which measurements are performed. This attribute is used
only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**. This value is
expressed in Hz.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment.
The default value is 2 GHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the highest frequency of the selected segment at which measurements are performed. This attribute is used
only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_STOP_FREQUENCY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_stop_frequency(self, selector_string, value):
r"""Sets the highest frequency of the selected segment at which measurements are performed. This attribute is used
only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**. This value is
expressed in Hz.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment.
The default value is 2 GHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the highest frequency of the selected segment at which measurements are performed. This attribute is used
only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**. This value is
expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_STOP_FREQUENCY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_number_of_frequency_points(self, selector_string):
r"""Gets the number of frequency points measured in the selected segment. This attribute is used only when you set
the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment.
The default value is 21.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of frequency points measured in the selected segment. This attribute is used only when you set
the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_NUMBER_OF_FREQUENCY_POINTS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_number_of_frequency_points(self, selector_string, value):
r"""Sets the number of frequency points measured in the selected segment. This attribute is used only when you set
the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment.
The default value is 21.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of frequency points measured in the selected segment. This attribute is used only when you set
the :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_NUMBER_OF_FREQUENCY_POINTS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_power_level_enabled(self, selector_string):
r"""Gets whether VNA performs measurements using the same source power level for all segments or uses different source
power level for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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) | All segments are measured with the source power level that you specify using Power Level attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------+
| True (1) | The selected segment is measured with the source power level that you specify using Segment Power Level attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SegmentPowerLevelEnabled):
Specifies whether VNA performs measurements using the same source power level for all segments or uses different source
power level for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_POWER_LEVEL_ENABLED.value
)
attr_val = enums.SegmentPowerLevelEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_power_level_enabled(self, selector_string, value):
r"""Sets whether VNA performs measurements using the same source power level for all segments or uses different source
power level for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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) | All segments are measured with the source power level that you specify using Power Level attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------+
| True (1) | The selected segment is measured with the source power level that you specify using Segment Power Level attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.SegmentPowerLevelEnabled, int):
Specifies whether VNA performs measurements using the same source power level for all segments or uses different source
power level for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
value = value.value if type(value) is enums.SegmentPowerLevelEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_POWER_LEVEL_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_power_level(self, selector_string):
r"""Gets the source power level for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_POWER_LEVEL_ENABLED` attribute to **True**. This value is expressed
in dBm.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port for
segment0. Use "port::*all*" to configure this attribute for all VNA ports for segment0.
Use "segment::<*segmentnumber*>/port::<*portname*>" as the selector string to configure or read this attribute
for a specific segment and for a specific VNA port. Use "segment::*all*/port::*all*" as the selector string to
configure this attribute for all segments and for all VNA ports.
The default value is -10 dBm.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the source power level for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_POWER_LEVEL_ENABLED` attribute to **True**. This value is expressed
in dBm.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_POWER_LEVEL.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_power_level(self, selector_string, value):
r"""Sets the source power level for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_POWER_LEVEL_ENABLED` attribute to **True**. This value is expressed
in dBm.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port for
segment0. Use "port::*all*" to configure this attribute for all VNA ports for segment0.
Use "segment::<*segmentnumber*>/port::<*portname*>" as the selector string to configure or read this attribute
for a specific segment and for a specific VNA port. Use "segment::*all*/port::*all*" as the selector string to
configure this attribute for all segments and for all VNA ports.
The default value is -10 dBm.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the source power level for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_POWER_LEVEL_ENABLED` attribute to **True**. This value is expressed
in dBm.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_POWER_LEVEL.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_if_bandwidth_enabled(self, selector_string):
r"""Gets whether VNA performs measurements using the same digital IF filter bandwidth for all segments or uses
different digital IF filter bandwidth for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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) | All segments are measured with the digital IF filter bandwidth that you specify using IF Bandwidth(Hz) attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The selected segment is measured with the digital IF filter bandwidth that you specify using Segment IF Bandwidth(Hz) |
| | attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SegmentIFBandwidthEnabled):
Specifies whether VNA performs measurements using the same digital IF filter bandwidth for all segments or uses
different digital IF filter bandwidth for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_IF_BANDWIDTH_ENABLED.value
)
attr_val = enums.SegmentIFBandwidthEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_if_bandwidth_enabled(self, selector_string, value):
r"""Sets whether VNA performs measurements using the same digital IF filter bandwidth for all segments or uses
different digital IF filter bandwidth for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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) | All segments are measured with the digital IF filter bandwidth that you specify using IF Bandwidth(Hz) attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The selected segment is measured with the digital IF filter bandwidth that you specify using Segment IF Bandwidth(Hz) |
| | attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.SegmentIFBandwidthEnabled, int):
Specifies whether VNA performs measurements using the same digital IF filter bandwidth for all segments or uses
different digital IF filter bandwidth for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
value = value.value if type(value) is enums.SegmentIFBandwidthEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_IF_BANDWIDTH_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_if_bandwidth(self, selector_string):
r"""Gets the digital IF filter bandwidth for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_IF_BANDWIDTH_ENABLED` attribute to **True**. This value is
expressed in Hz.
NI PXIe-5633 supports the following IF Bandwidths: 1, 2, 3, 5, 7, 10, 20, 30, 50, 70, 100, 200, 300, 500, 700,
1k, 2k, 3k, 5k, 7k, 10k, 20k, 30k, 50k, 70k, 100k, 200k, 300k, 500k, 700k, 1M, 2M, 3M, 5M, 7M, 10M, 15M. If you set
this attribute to an unsupported value, RFmx automatically coerces to the smallest supported IF Bandwidth greater than
or equal to the value you set. If you set IF Bandwidth to a value higher than the maximum supported value, RFmx
automatically coerces it to maximum supported IF Bandwidth.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment. Use "segment::*all*" as the selector string to configure this attribute for all segments.
The default value is 100 kHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the digital IF filter bandwidth for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_IF_BANDWIDTH_ENABLED` attribute to **True**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_IF_BANDWIDTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_if_bandwidth(self, selector_string, value):
r"""Sets the digital IF filter bandwidth for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_IF_BANDWIDTH_ENABLED` attribute to **True**. This value is
expressed in Hz.
NI PXIe-5633 supports the following IF Bandwidths: 1, 2, 3, 5, 7, 10, 20, 30, 50, 70, 100, 200, 300, 500, 700,
1k, 2k, 3k, 5k, 7k, 10k, 20k, 30k, 50k, 70k, 100k, 200k, 300k, 500k, 700k, 1M, 2M, 3M, 5M, 7M, 10M, 15M. If you set
this attribute to an unsupported value, RFmx automatically coerces to the smallest supported IF Bandwidth greater than
or equal to the value you set. If you set IF Bandwidth to a value higher than the maximum supported value, RFmx
automatically coerces it to maximum supported IF Bandwidth.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment. Use "segment::*all*" as the selector string to configure this attribute for all segments.
The default value is 100 kHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the digital IF filter bandwidth for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_IF_BANDWIDTH_ENABLED` attribute to **True**. This value is
expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_IF_BANDWIDTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_test_receiver_attenuation_enabled(self, selector_string):
r"""Gets whether VNA performs measurements using the same test receiver attenuation for all segments or uses different
test receiver attenuation for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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) | All segments are measured with the test receiver attenuation that you specify using Test Receiver Attenuation |
| | attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The selected segment is measured with the test receiver attenuation that you specify using Segment Test Receiver |
| | Attenuation attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SegmentTestReceiverAttenuationEnabled):
Specifies whether VNA performs measurements using the same test receiver attenuation for all segments or uses different
test receiver attenuation for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_TEST_RECEIVER_ATTENUATION_ENABLED.value,
)
attr_val = enums.SegmentTestReceiverAttenuationEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_test_receiver_attenuation_enabled(self, selector_string, value):
r"""Sets whether VNA performs measurements using the same test receiver attenuation for all segments or uses different
test receiver attenuation for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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) | All segments are measured with the test receiver attenuation that you specify using Test Receiver Attenuation |
| | attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The selected segment is measured with the test receiver attenuation that you specify using Segment Test Receiver |
| | Attenuation attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.SegmentTestReceiverAttenuationEnabled, int):
Specifies whether VNA performs measurements using the same test receiver attenuation for all segments or uses different
test receiver attenuation for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
value = (
value.value if type(value) is enums.SegmentTestReceiverAttenuationEnabled else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_TEST_RECEIVER_ATTENUATION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_test_receiver_attenuation(self, selector_string):
r"""Gets the test receiver attenuation for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_TEST_RECEIVER_ATTENUATION_ENABLED` attribute to **True**. This
value is expressed in dB.
The receiver that measures the scattered waves traveling away from the DUT port and towards the VNA port is
referred to as the Test Receiver. VNA uses Test Receiver Attenuation to attenuate the RF signal before it reaches the
downconverting mixer on the path towards the Test Receiver.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port for
segment0. Use "port::*all*" to configure this attribute for all VNA ports for segment0.
Use "segment::<*segmentnumber*>/port::<*portname*>" as the selector string to configure or read this attribute
for a specific segment and for a specific VNA port. Use "segment::*all*/port::*all*" as the selector string to
configure this attribute for all segment and for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the test receiver attenuation for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_TEST_RECEIVER_ATTENUATION_ENABLED` attribute to **True**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_TEST_RECEIVER_ATTENUATION.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_test_receiver_attenuation(self, selector_string, value):
r"""Sets the test receiver attenuation for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_TEST_RECEIVER_ATTENUATION_ENABLED` attribute to **True**. This
value is expressed in dB.
The receiver that measures the scattered waves traveling away from the DUT port and towards the VNA port is
referred to as the Test Receiver. VNA uses Test Receiver Attenuation to attenuate the RF signal before it reaches the
downconverting mixer on the path towards the Test Receiver.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port for
segment0. Use "port::*all*" to configure this attribute for all VNA ports for segment0.
Use "segment::<*segmentnumber*>/port::<*portname*>" as the selector string to configure or read this attribute
for a specific segment and for a specific VNA port. Use "segment::*all*/port::*all*" as the selector string to
configure this attribute for all segment and for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the test receiver attenuation for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_TEST_RECEIVER_ATTENUATION_ENABLED` attribute to **True**. This
value is expressed in dB.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_TEST_RECEIVER_ATTENUATION.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_dwell_time_enabled(self, selector_string):
r"""Gets whether VNA performs measurements using the same dwell time value for all segments or uses different dwell
time for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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) | All segments are measured with the dwell time that you specify using Dwell Time attribute. |
+--------------+-----------------------------------------------------------------------------------------------------------+
| True (1) | The selected segment is measured with the dwell time that you specify using Segment Dwell Time attribute. |
+--------------+-----------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SegmentDwellTimeEnabled):
Specifies whether VNA performs measurements using the same dwell time value for all segments or uses different dwell
time for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_DWELL_TIME_ENABLED.value
)
attr_val = enums.SegmentDwellTimeEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_dwell_time_enabled(self, selector_string, value):
r"""Sets whether VNA performs measurements using the same dwell time value for all segments or uses different dwell
time for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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) | All segments are measured with the dwell time that you specify using Dwell Time attribute. |
+--------------+-----------------------------------------------------------------------------------------------------------+
| True (1) | The selected segment is measured with the dwell time that you specify using Segment Dwell Time attribute. |
+--------------+-----------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.SegmentDwellTimeEnabled, int):
Specifies whether VNA performs measurements using the same dwell time value for all segments or uses different dwell
time for each segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment**.
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
)
value = value.value if type(value) is enums.SegmentDwellTimeEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.SEGMENT_DWELL_TIME_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_segment_dwell_time(self, selector_string):
r"""Gets the dwell time for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_DWELL_TIME_ENABLED` attribute to **True**. This value is expressed
in seconds.
Dwell Time specifies the time for which the analyzer waits before acquiring the signal for each measured
frequency point. Use dwell time when measuring devices with substantial electrical lengths, requiring compensation for
the delay between frequency changes at the generator and their observation at the analyzer.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment. Use "segment::*all*" as the selector string to configure this attribute for all segments.
The default value is 0 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the dwell time for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_DWELL_TIME_ENABLED` attribute to **True**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_DWELL_TIME.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_segment_dwell_time(self, selector_string, value):
r"""Sets the dwell time for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_DWELL_TIME_ENABLED` attribute to **True**. This value is expressed
in seconds.
Dwell Time specifies the time for which the analyzer waits before acquiring the signal for each measured
frequency point. Use dwell time when measuring devices with substantial electrical lengths, requiring compensation for
the delay between frequency changes at the generator and their observation at the analyzer.
Use "segment::<*segmentnumber*>" as the selector string to configure or read this attribute for a specific
segment. Use "segment::*all*" as the selector string to configure this attribute for all segments.
The default value is 0 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the dwell time for the selected segment. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute to **Segment** and
:py:attr:`~nirfmxvna.attributes.AttributeID.SEGMENT_DWELL_TIME_ENABLED` attribute to **True**. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.SEGMENT_DWELL_TIME.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_mode_enabled(self, selector_string):
r"""Gets whether to use pulsed RF signal as stimulus and/or export pulse generator digital signals.
To perform measurements in pulse mode, start by setting this attribute to True. Next, configure basic pulse
attributes like :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD`,
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODULATOR_WIDTH`.
When you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` to **None**, where VNA generates a
pulse trigger internally. Pulse Trigger is used to control the timing of the RF pulse modulator. Additionally pulse
trigger is used as timing reference for all the pulse generator digital signals that you enabled.
You can override the internal pulse trigger to an external pulse trigger by setting
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` to **Digital 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 **False**.
+--------------+---------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+=======================================================================================+
| False (0) | Disables pulse mode operation. VNA pulse modulator and pulse generators are disabled. |
+--------------+---------------------------------------------------------------------------------------+
| True (1) | Enables pulse mode operation. |
+--------------+---------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseModeEnabled):
Specifies whether to use pulsed RF signal as stimulus and/or export pulse generator digital signals.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_MODE_ENABLED.value
)
attr_val = enums.PulseModeEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_mode_enabled(self, selector_string, value):
r"""Sets whether to use pulsed RF signal as stimulus and/or export pulse generator digital signals.
To perform measurements in pulse mode, start by setting this attribute to True. Next, configure basic pulse
attributes like :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD`,
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODULATOR_WIDTH`.
When you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` to **None**, where VNA generates a
pulse trigger internally. Pulse Trigger is used to control the timing of the RF pulse modulator. Additionally pulse
trigger is used as timing reference for all the pulse generator digital signals that you enabled.
You can override the internal pulse trigger to an external pulse trigger by setting
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` to **Digital 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 **False**.
+--------------+---------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+=======================================================================================+
| False (0) | Disables pulse mode operation. VNA pulse modulator and pulse generators are disabled. |
+--------------+---------------------------------------------------------------------------------------+
| True (1) | Enables pulse mode operation. |
+--------------+---------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseModeEnabled, int):
Specifies whether to use pulsed RF signal as stimulus and/or export pulse generator digital signals.
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
)
value = value.value if type(value) is enums.PulseModeEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_MODE_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_trigger_type(self, selector_string):
r"""Gets the pulse trigger type. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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 **None**.
+------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==================+==========================================================================================================================+
| None (0) | Based on the Pulse Period value that you set, the VNA creates an appropriate periodic pulse trigger internally. Pulse |
| | Trigger is used to control the timing of the RF pulse modulator. Additionally pulse trigger is used as timing reference |
| | for all the pulse generator digital signals that you enabled. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
| Digital Edge (1) | Uses an external digital edge trigger as the pulse trigger. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseTriggerType):
Specifies the pulse trigger type. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_TRIGGER_TYPE.value
)
attr_val = enums.PulseTriggerType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_trigger_type(self, selector_string, value):
r"""Sets the pulse trigger type. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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 **None**.
+------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==================+==========================================================================================================================+
| None (0) | Based on the Pulse Period value that you set, the VNA creates an appropriate periodic pulse trigger internally. Pulse |
| | Trigger is used to control the timing of the RF pulse modulator. Additionally pulse trigger is used as timing reference |
| | for all the pulse generator digital signals that you enabled. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
| Digital Edge (1) | Uses an external digital edge trigger as the pulse trigger. |
+------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseTriggerType, int):
Specifies the pulse trigger type. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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
)
value = value.value if type(value) is enums.PulseTriggerType else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_TRIGGER_TYPE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_digital_edge_trigger_source(self, selector_string):
r"""Gets the source of the digital edge pulse trigger. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` attribute to **Digital 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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the source of the digital edge pulse trigger. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` attribute to **Digital 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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.PULSE_DIGITAL_EDGE_TRIGGER_SOURCE.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_digital_edge_trigger_source(self, selector_string, value):
r"""Sets the source of the digital edge pulse trigger. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` attribute to **Digital 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 of this attribute is "" (empty string).
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the source of the digital edge pulse trigger. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` attribute to **Digital 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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.PULSE_DIGITAL_EDGE_TRIGGER_SOURCE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_period(self, selector_string):
r"""Gets the time interval after which the pulse repeats. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. If you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` attribute to **Digital Edge**, pulses are generated
only when an external pulse digital edge trigger is received by the VNA. 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 1 ms.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the time interval after which the pulse repeats. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. If you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` attribute to **Digital Edge**, pulses are generated
only when an external pulse digital edge trigger is received by the VNA. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_PERIOD.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_period(self, selector_string, value):
r"""Sets the time interval after which the pulse repeats. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. If you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` attribute to **Digital Edge**, pulses are generated
only when an external pulse digital edge trigger is received by the VNA. 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 1 ms.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the time interval after which the pulse repeats. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. If you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` attribute to **Digital Edge**, pulses are generated
only when an external pulse digital edge trigger is received by the VNA. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_PERIOD.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_modulator_delay(self, selector_string):
r"""Gets the delay between the pulse trigger digital edge and the rising edge of the RF pulse. This attribute is used
only when you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. 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 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the delay between the pulse trigger digital edge and the rising edge of the RF pulse. This attribute is used
only when you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_MODULATOR_DELAY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_modulator_delay(self, selector_string, value):
r"""Sets the delay between the pulse trigger digital edge and the rising edge of the RF pulse. This attribute is used
only when you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. 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 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the delay between the pulse trigger digital edge and the rising edge of the RF pulse. This attribute is used
only when you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_MODULATOR_DELAY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_modulator_width(self, selector_string):
r"""Gets the Pulse Width of the pulsed RF signal. Pulse is in HIGH state for a duration equal to the Pulse Width, and
remains in the LOW state for the rest of the Pulse Period. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. 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 100 us.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the Pulse Width of the pulsed RF signal. Pulse is in HIGH state for a duration equal to the Pulse Width, and
remains in the LOW state for the rest of the Pulse Period. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_MODULATOR_WIDTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_modulator_width(self, selector_string, value):
r"""Sets the Pulse Width of the pulsed RF signal. Pulse is in HIGH state for a duration equal to the Pulse Width, and
remains in the LOW state for the rest of the Pulse Period. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. 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 100 us.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the Pulse Width of the pulsed RF signal. Pulse is in HIGH state for a duration equal to the Pulse Width, and
remains in the LOW state for the rest of the Pulse Period. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_MODULATOR_WIDTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_acquisition_auto(self, selector_string):
r"""Gets whether, based on :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODULATOR_WIDTH`, the measurement
automatically sets appropriate :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_DELAY` and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_WIDTH`. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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 **True**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The Pulse Acquisition Delay and Pulse Acquisition Width attributes are not automatically set by the measurement. The |
| | values that you set for these attributes are used by the measurement. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement uses the Pulse Modulator Width |
| | attribute to automatically set appropriate values for Pulse Acquisition Delay and Pulse Acquisition Width attributes. |
| | Pulse Acquisition Delay is set as the sum of Pulse Modulator Delay and approximately 20% of the Pulse Modulator Width, |
| | and Pulse Acquisition Width is set to approximately 75% of the Pulse Modulator Width. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseAcquisitionAuto):
Specifies whether, based on :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODULATOR_WIDTH`, the measurement
automatically sets appropriate :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_DELAY` and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_WIDTH`. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_ACQUISITION_AUTO.value
)
attr_val = enums.PulseAcquisitionAuto(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_acquisition_auto(self, selector_string, value):
r"""Sets whether, based on :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODULATOR_WIDTH`, the measurement
automatically sets appropriate :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_DELAY` and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_WIDTH`. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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 **True**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| False (0) | The Pulse Acquisition Delay and Pulse Acquisition Width attributes are not automatically set by the measurement. The |
| | values that you set for these attributes are used by the measurement. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement uses the Pulse Modulator Width |
| | attribute to automatically set appropriate values for Pulse Acquisition Delay and Pulse Acquisition Width attributes. |
| | Pulse Acquisition Delay is set as the sum of Pulse Modulator Delay and approximately 20% of the Pulse Modulator Width, |
| | and Pulse Acquisition Width is set to approximately 75% of the Pulse Modulator Width. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseAcquisitionAuto, int):
Specifies whether, based on :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODULATOR_WIDTH`, the measurement
automatically sets appropriate :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_DELAY` and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_WIDTH`. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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
)
value = value.value if type(value) is enums.PulseAcquisitionAuto else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_ACQUISITION_AUTO.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_acquisition_delay(self, selector_string):
r"""Gets the delay in the start of the pulse acquisition relative to the pulse trigger. Pulse trigger can be internal
or external. When you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` to **None** then the VNA
creates appropriate periodic pulse triggers internally. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_AUTO` attribute to **False**. 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 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the delay in the start of the pulse acquisition relative to the pulse trigger. Pulse trigger can be internal
or external. When you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` to **None** then the VNA
creates appropriate periodic pulse triggers internally. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_AUTO` attribute to **False**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_ACQUISITION_DELAY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_acquisition_delay(self, selector_string, value):
r"""Sets the delay in the start of the pulse acquisition relative to the pulse trigger. Pulse trigger can be internal
or external. When you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` to **None** then the VNA
creates appropriate periodic pulse triggers internally. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_AUTO` attribute to **False**. 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 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the delay in the start of the pulse acquisition relative to the pulse trigger. Pulse trigger can be internal
or external. When you set :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_TRIGGER_TYPE` to **None** then the VNA
creates appropriate periodic pulse triggers internally. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_AUTO` attribute to **False**. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_ACQUISITION_DELAY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_acquisition_width(self, selector_string):
r"""Gets the acquisition-time per point for pulse measurements. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_AUTO` attribute to **False**. 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 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the acquisition-time per point for pulse measurements. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_AUTO` attribute to **False**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_ACQUISITION_WIDTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_acquisition_width(self, selector_string, value):
r"""Sets the acquisition-time per point for pulse measurements. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_AUTO` attribute to **False**. 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 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the acquisition-time per point for pulse measurements. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_ACQUISITION_AUTO` attribute to **False**. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_ACQUISITION_WIDTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_generator_enabled(self, selector_string):
r"""Gets whether to enable a pulse generator. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**.
Use "pulsegen<*n*>" as the selector string to configure or read this attribute.
The default value is **False**.
+--------------+----------------------------------------+
| Name (Value) | Description |
+==============+========================================+
| False (0) | Disables the selected pulse generator. |
+--------------+----------------------------------------+
| True (1) | Enables the selected pulse generator. |
+--------------+----------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.PulseGeneratorEnabled):
Specifies whether to enable a pulse generator. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_GENERATOR_ENABLED.value
)
attr_val = enums.PulseGeneratorEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_generator_enabled(self, selector_string, value):
r"""Sets whether to enable a pulse generator. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True**.
Use "pulsegen<*n*>" as the selector string to configure or read this attribute.
The default value is **False**.
+--------------+----------------------------------------+
| Name (Value) | Description |
+==============+========================================+
| False (0) | Disables the selected pulse generator. |
+--------------+----------------------------------------+
| True (1) | Enables the selected pulse generator. |
+--------------+----------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.PulseGeneratorEnabled, int):
Specifies whether to enable a pulse generator. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_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
)
value = value.value if type(value) is enums.PulseGeneratorEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_GENERATOR_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_generator_export_output_terminal(self, selector_string):
r"""Gets the destination terminal for an exported Pulse Generator. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_ENABLED` attribute to **True**.
Use "pulsegen<*n*>" as the selector string to configure or read this attribute.
The default value is **Do not export signal**.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the destination terminal for an exported Pulse Generator. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.PULSE_GENERATOR_EXPORT_OUTPUT_TERMINAL.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_generator_export_output_terminal(self, selector_string, value):
r"""Sets the destination terminal for an exported Pulse Generator. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_ENABLED` attribute to **True**.
Use "pulsegen<*n*>" as the selector string to configure or read this attribute.
The default value is **Do not export signal**.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the destination terminal for an exported Pulse Generator. This attribute is used only when you set
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_MODE_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.PULSE_GENERATOR_EXPORT_OUTPUT_TERMINAL.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_generator_terminal_name(self, selector_string):
r"""Gets the fully qualified signal name as a string.
The standard format of the returned fully qualified signal name is */ModuleName/vna/0/Pulse0Event*, where
*ModuleName* is the name of your device in MAX.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Returns the fully qualified signal name as a string.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_GENERATOR_TERMINAL_NAME.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def get_pulse_generator_delay(self, selector_string):
r"""Gets the delay between the pulse trigger and digital pulse generated by the selected Pulse Generator. You must set
the value of the this attribute such that Delay + :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_WIDTH`
attribute does not exceed :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD` attribute. This value is expressed
in seconds.
Use "pulsegen<*n*>" as the selector string to configure or read this attribute.
The default value is 0 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the delay between the pulse trigger and digital pulse generated by the selected Pulse Generator. You must set
the value of the this attribute such that Delay + :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_WIDTH`
attribute does not exceed :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD` attribute. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_GENERATOR_DELAY.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_generator_delay(self, selector_string, value):
r"""Sets the delay between the pulse trigger and digital pulse generated by the selected Pulse Generator. You must set
the value of the this attribute such that Delay + :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_WIDTH`
attribute does not exceed :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD` attribute. This value is expressed
in seconds.
Use "pulsegen<*n*>" as the selector string to configure or read this attribute.
The default value is 0 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the delay between the pulse trigger and digital pulse generated by the selected Pulse Generator. You must set
the value of the this attribute such that Delay + :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_WIDTH`
attribute does not exceed :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD` attribute. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_GENERATOR_DELAY.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_pulse_generator_width(self, selector_string):
r"""Gets the pulse width of the selected pulse generator.
You must set the values of the :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_DELAY` attribute and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_WIDTH` attribute such that Delay + Width does not exceed
the value of :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD` attribute. This value is expressed in seconds.
Use "pulsegen<*n*>" as the selector string to configure or read this attribute.
The default value is 100us.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the pulse width of the selected pulse generator.
You must set the values of the :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_DELAY` attribute and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_WIDTH` attribute such that Delay + Width does not exceed
the value of :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD` attribute. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_GENERATOR_WIDTH.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_pulse_generator_width(self, selector_string, value):
r"""Sets the pulse width of the selected pulse generator.
You must set the values of the :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_DELAY` attribute and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_WIDTH` attribute such that Delay + Width does not exceed
the value of :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD` attribute. This value is expressed in seconds.
Use "pulsegen<*n*>" as the selector string to configure or read this attribute.
The default value is 100us.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the pulse width of the selected pulse generator.
You must set the values of the :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_DELAY` attribute and
:py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_GENERATOR_WIDTH` attribute such that Delay + Width does not exceed
the value of :py:attr:`~nirfmxvna.attributes.AttributeID.PULSE_PERIOD` attribute. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.PULSE_GENERATOR_WIDTH.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_x_axis_values(self, selector_string):
r"""Gets an array of frequency values when you perform measurements with
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute set to **List** or **Linear** or **Segment** or an
array of time values when you perform measurements with :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE`
attribute set to **CW Time**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns an array of frequency values when you perform measurements with
:py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE` attribute set to **List** or **Linear** or **Segment** or an
array of time values when you perform measurements with :py:attr:`~nirfmxvna.attributes.AttributeID.SWEEP_TYPE`
attribute set to **CW Time**.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64_array( # type: ignore
updated_selector_string, attributes.AttributeID.X_AXIS_VALUES.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def get_averaging_enabled(self, selector_string):
r"""Gets whether to enable measurement averaging.
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) | Disables measurement averaging. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | Enables measurement averaging. You can set number of times each measurement is repeated and averaged-over using the |
| | Averaging Count attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.AveragingEnabled):
Specifies whether to enable measurement averaging.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.AVERAGING_ENABLED.value
)
attr_val = enums.AveragingEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_averaging_enabled(self, selector_string, value):
r"""Sets whether to enable measurement averaging.
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) | Disables measurement averaging. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| True (1) | Enables measurement averaging. You can set number of times each measurement is repeated and averaged-over using the |
| | Averaging Count attribute. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.AveragingEnabled, int):
Specifies whether to enable measurement averaging.
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
)
value = value.value if type(value) is enums.AveragingEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.AVERAGING_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_averaging_count(self, selector_string):
r"""Gets the number of times each measurement is repeated and averaged-over. This attribute is used only when you set
the :py:attr:`~nirfmxvna.attributes.AttributeID.AVERAGING_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 10.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Specifies the number of times each measurement is repeated and averaged-over. This attribute is used only when you set
the :py:attr:`~nirfmxvna.attributes.AttributeID.AVERAGING_ENABLED` attribute to **True**.
error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.AVERAGING_COUNT.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_averaging_count(self, selector_string, value):
r"""Sets the number of times each measurement is repeated and averaged-over. This attribute is used only when you set
the :py:attr:`~nirfmxvna.attributes.AttributeID.AVERAGING_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 10.
Args:
selector_string (string):
Pass an empty string.
value (int):
Specifies the number of times each measurement is repeated and averaged-over. This attribute is used only when you set
the :py:attr:`~nirfmxvna.attributes.AttributeID.AVERAGING_ENABLED` attribute to **True**.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.AVERAGING_COUNT.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_enabled(self, selector_string):
r"""Gets whether to enable error correction for VNA measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+-------------------------------------------+
| Name (Value) | Description |
+==============+===========================================+
| False (0) | The measurement disables error corection. |
+--------------+-------------------------------------------+
| True (1) | The measurement enables error correction. |
+--------------+-------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionEnabled):
Specifies whether to enable error correction for VNA 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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.CORRECTION_ENABLED.value
)
attr_val = enums.CorrectionEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_enabled(self, selector_string, value):
r"""Sets whether to enable error correction for VNA measurement.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is **False**.
+--------------+-------------------------------------------+
| Name (Value) | Description |
+==============+===========================================+
| False (0) | The measurement disables error corection. |
+--------------+-------------------------------------------+
| True (1) | The measurement enables error correction. |
+--------------+-------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionEnabled, int):
Specifies whether to enable error correction for VNA 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
)
value = value.value if type(value) is enums.CorrectionEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.CORRECTION_ENABLED.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_interpolation_enabled(self, selector_string):
r"""Gets whether to enable interpolation of error terms for corrected VNA measurement. This attribute is used only
when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_ENABLED` attribute to **True**.
Specifies whether to enable interpolation of error terms for corrected VNA measurement. If set to **True**, the
interpolated error terms are used for each measurement frequency point, for which error terms do not exist in the
calset, provided that *minimum calset frequency <= measurement frequency and <= maximum calset frequency*.
The impact of interpolation on the accuracy of the VNA measurements strongly depends on the measurement
conditions and can range from severe degradation to no degradation at all. In case the phase difference between two
consecutive error terms *e[n-1], e[n]* exceeds 180deg, the interpolation will lead to large measurement errors.
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) | The measurement disables interpolation of error terms for error correction. |
+--------------+-----------------------------------------------------------------------------+
| True (1) | The measurement enables interpolation of error terms for error correction. |
+--------------+-----------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionInterpolationEnabled):
Specifies whether to enable interpolation of error terms for corrected VNA measurement. This attribute is used only
when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_INTERPOLATION_ENABLED.value,
)
attr_val = enums.CorrectionInterpolationEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_interpolation_enabled(self, selector_string, value):
r"""Sets whether to enable interpolation of error terms for corrected VNA measurement. This attribute is used only
when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_ENABLED` attribute to **True**.
Specifies whether to enable interpolation of error terms for corrected VNA measurement. If set to **True**, the
interpolated error terms are used for each measurement frequency point, for which error terms do not exist in the
calset, provided that *minimum calset frequency <= measurement frequency and <= maximum calset frequency*.
The impact of interpolation on the accuracy of the VNA measurements strongly depends on the measurement
conditions and can range from severe degradation to no degradation at all. In case the phase difference between two
consecutive error terms *e[n-1], e[n]* exceeds 180deg, the interpolation will lead to large measurement errors.
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) | The measurement disables interpolation of error terms for error correction. |
+--------------+-----------------------------------------------------------------------------+
| True (1) | The measurement enables interpolation of error terms for error correction. |
+--------------+-----------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionInterpolationEnabled, int):
Specifies whether to enable interpolation of error terms for corrected VNA measurement. This attribute is used only
when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_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
)
value = value.value if type(value) is enums.CorrectionInterpolationEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_INTERPOLATION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_subset_enabled(self, selector_string):
r"""Gets whether to enable correction for a subset of ports for which calibration data is avaialble in the calset.
This attribute is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_ENABLED` attribute
to **True**.
Enable this attribute to exclude subset of calset ports from measurement error correction, to achieve faster
measurement speed by avoiding extra acquisitions. Use
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS` and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` to specify the list of subset ports
to be included in the measurement error correction.
The default value is **False**.
+--------------+----------------------------------------------------------------+
| Name (Value) | Description |
+==============+================================================================+
| False (0) | The measurement disables port-subsetting for error correction. |
+--------------+----------------------------------------------------------------+
| True (1) | The measurement enabes port-subsetting for error correction. |
+--------------+----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortSubsetEnabled):
Specifies whether to enable correction for a subset of ports for which calibration data is avaialble in the calset.
This attribute is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.CORRECTION_PORT_SUBSET_ENABLED.value
)
attr_val = enums.CorrectionPortSubsetEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_subset_enabled(self, selector_string, value):
r"""Sets whether to enable correction for a subset of ports for which calibration data is avaialble in the calset.
This attribute is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_ENABLED` attribute
to **True**.
Enable this attribute to exclude subset of calset ports from measurement error correction, to achieve faster
measurement speed by avoiding extra acquisitions. Use
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS` and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` to specify the list of subset ports
to be included in the measurement error correction.
The default value is **False**.
+--------------+----------------------------------------------------------------+
| Name (Value) | Description |
+==============+================================================================+
| False (0) | The measurement disables port-subsetting for error correction. |
+--------------+----------------------------------------------------------------+
| True (1) | The measurement enabes port-subsetting for error correction. |
+--------------+----------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortSubsetEnabled, int):
Specifies whether to enable correction for a subset of ports for which calibration data is avaialble in the calset.
This attribute is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_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
)
value = value.value if type(value) is enums.CorrectionPortSubsetEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_SUBSET_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_subset_full_ports(self, selector_string):
r"""Gets the subset of ports, that are selected for full N-Port correction, where N is the number of ports specified
in this attribute. Use comma-separated list of ports to specify multiple ports. The configured measurement is full
N-Port corrected if both the measurement receiver and source port are specified using this attribute. The configured
measurement is one-path two-port corrected if one of the measurement ports is specified using this attribute and
another is specified using :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS`.
Measurements involving the ports outside :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS`
and :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` return error.
This attribute is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_ENABLED`
attribute to **True** and :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_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 an empty string.
For example, when performing S11 error-corrected measurement for a 1-port DUT using a 2-port VNA and a 2-port
calset, VNA generally acquires data by setting the source to port1 first and then to port2. In this case, to achieve
faster measurement speed, set this attribute to **port1**, which lets the VNA acquire data using only source port1 and
skips acquiring data with source port2.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the subset of ports, that are selected for full N-Port correction, where N is the number of ports specified
in this attribute. Use comma-separated list of ports to specify multiple ports. The configured measurement is full
N-Port corrected if both the measurement receiver and source port are specified using this attribute. The configured
measurement is one-path two-port corrected if one of the measurement ports is specified using this attribute and
another is specified using :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS`.
Measurements involving the ports outside :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS`
and :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` return error.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_subset_full_ports(self, selector_string, value):
r"""Sets the subset of ports, that are selected for full N-Port correction, where N is the number of ports specified
in this attribute. Use comma-separated list of ports to specify multiple ports. The configured measurement is full
N-Port corrected if both the measurement receiver and source port are specified using this attribute. The configured
measurement is one-path two-port corrected if one of the measurement ports is specified using this attribute and
another is specified using :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS`.
Measurements involving the ports outside :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS`
and :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` return error.
This attribute is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_ENABLED`
attribute to **True** and :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_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 an empty string.
For example, when performing S11 error-corrected measurement for a 1-port DUT using a 2-port VNA and a 2-port
calset, VNA generally acquires data by setting the source to port1 first and then to port2. In this case, to achieve
faster measurement speed, set this attribute to **port1**, which lets the VNA acquire data using only source port1 and
skips acquiring data with source port2.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the subset of ports, that are selected for full N-Port correction, where N is the number of ports specified
in this attribute. Use comma-separated list of ports to specify multiple ports. The configured measurement is full
N-Port corrected if both the measurement receiver and source port are specified using this attribute. The configured
measurement is one-path two-port corrected if one of the measurement ports is specified using this attribute and
another is specified using :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS`.
Measurements involving the ports outside :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS`
and :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` return error.
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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_subset_response_ports(self, selector_string):
r"""Gets the subset of ports, that are selected for one-path two-port error correction. Use comma-separated list of
ports to specify multiple ports. The configured measurement is one-path two-port corrected if both measurement ports
are specified using this attribute. Alternatively, measurement is also one-path two-port corrected if one of the
measurement port is specified using this attribute and another is specified using
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS`. Measurements involving the ports
outside the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS` return error.
This attribute is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_ENABLED`
attribute to **True** and :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_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 an empty string.
For example, when performing S21 error-corrected measurement for a 2-port DUT using a 2-port VNA and a 2-port
calset, VNA generally acquires data by setting the source to port1 first and then to port2. To perform S21 one-path
two-port error corrected measurement and to achieve faster measurement speed, set this attribute to **port1, port2**.
VNA then acquires data using source port1 and skips acquiring data with source port2.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the subset of ports, that are selected for one-path two-port error correction. Use comma-separated list of
ports to specify multiple ports. The configured measurement is one-path two-port corrected if both measurement ports
are specified using this attribute. Alternatively, measurement is also one-path two-port corrected if one of the
measurement port is specified using this attribute and another is specified using
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS`. Measurements involving the ports
outside the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS` return error.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_subset_response_ports(self, selector_string, value):
r"""Sets the subset of ports, that are selected for one-path two-port error correction. Use comma-separated list of
ports to specify multiple ports. The configured measurement is one-path two-port corrected if both measurement ports
are specified using this attribute. Alternatively, measurement is also one-path two-port corrected if one of the
measurement port is specified using this attribute and another is specified using
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS`. Measurements involving the ports
outside the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS` return error.
This attribute is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_ENABLED`
attribute to **True** and :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_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 an empty string.
For example, when performing S21 error-corrected measurement for a 2-port DUT using a 2-port VNA and a 2-port
calset, VNA generally acquires data by setting the source to port1 first and then to port2. To perform S21 one-path
two-port error corrected measurement and to achieve faster measurement speed, set this attribute to **port1, port2**.
VNA then acquires data using source port1 and skips acquiring data with source port2.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the subset of ports, that are selected for one-path two-port error correction. Use comma-separated list of
ports to specify multiple ports. The configured measurement is one-path two-port corrected if both measurement ports
are specified using this attribute. Alternatively, measurement is also one-path two-port corrected if one of the
measurement port is specified using this attribute and another is specified using
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS`. Measurements involving the ports
outside the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS` and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_SUBSET_FULL_PORTS` return error.
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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_SUBSET_RESPONSE_PORTS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_enabled(self, selector_string):
r"""Gets whether to enable port extension.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **False**.
+--------------+------------------------------------------+
| Name (Value) | Description |
+==============+==========================================+
| False (0) | The measurement disables port extension. |
+--------------+------------------------------------------+
| True (1) | The measurement enables port extension. |
+--------------+------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionEnabled):
Specifies whether to enable port extension.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED.value,
)
attr_val = enums.CorrectionPortExtensionEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_enabled(self, selector_string, value):
r"""Sets whether to enable port extension.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **False**.
+--------------+------------------------------------------+
| Name (Value) | Description |
+==============+==========================================+
| False (0) | The measurement disables port extension. |
+--------------+------------------------------------------+
| True (1) | The measurement enables port extension. |
+--------------+------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionEnabled, int):
Specifies whether to enable port extension.
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
)
value = value.value if type(value) is enums.CorrectionPortExtensionEnabled else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_delay_domain(self, selector_string):
r"""Gets whether port extension utilizes delay-based or distance-velocity factor-based definition. This attribute is
used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to
**True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **Delay**.
+--------------+-------------------------------------------------------------------+
| Name (Value) | Description |
+==============+===================================================================+
| Delay (0) | The port extension is specified in terms of its electrical delay. |
+--------------+-------------------------------------------------------------------+
| Distance (1) | The port extension is specified in terms of its physical length. |
+--------------+-------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionDelayDomain):
Specifies whether port extension utilizes delay-based or distance-velocity factor-based definition. This attribute is
used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN.value,
)
attr_val = enums.CorrectionPortExtensionDelayDomain(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_delay_domain(self, selector_string, value):
r"""Sets whether port extension utilizes delay-based or distance-velocity factor-based definition. This attribute is
used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to
**True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **Delay**.
+--------------+-------------------------------------------------------------------+
| Name (Value) | Description |
+==============+===================================================================+
| Delay (0) | The port extension is specified in terms of its electrical delay. |
+--------------+-------------------------------------------------------------------+
| Distance (1) | The port extension is specified in terms of its physical length. |
+--------------+-------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionDelayDomain, int):
Specifies whether port extension utilizes delay-based or distance-velocity factor-based definition. This attribute is
used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_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
)
value = (
value.value if type(value) is enums.CorrectionPortExtensionDelayDomain else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_delay(self, selector_string):
r"""Gets the port extension electrical delay. This value is expressed in seconds. This attribute is used only when you
set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure the same delay value for all VNA ports.
The default value is 0 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the port extension electrical delay. This value is expressed in seconds. This attribute is used only when you
set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_delay(self, selector_string, value):
r"""Sets the port extension electrical delay. This value is expressed in seconds. This attribute is used only when you
set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure the same delay value for all VNA ports.
The default value is 0 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the port extension electrical delay. This value is expressed in seconds. This attribute is used only when you
set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_distance(self, selector_string):
r"""Gets the port extension delay in physical length. This value is expressed in meters by default. The unit can be
chosen by setting the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE_UNIT` attribute.
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure the same distance value for all VNA ports.
The default value is 0 m.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the port extension delay in physical length. This value is expressed in meters by default. The unit can be
chosen by setting the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE_UNIT` attribute.
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_distance(self, selector_string, value):
r"""Sets the port extension delay in physical length. This value is expressed in meters by default. The unit can be
chosen by setting the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE_UNIT` attribute.
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure the same distance value for all VNA ports.
The default value is 0 m.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the port extension delay in physical length. This value is expressed in meters by default. The unit can be
chosen by setting the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE_UNIT` attribute.
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_distance_unit(self, selector_string):
r"""Gets the unit of the port extension delay in physical length. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure the same distance unit for all VNA ports.
The default value is **Meters**.
+--------------+------------------------------------------------------------+
| Name (Value) | Description |
+==============+============================================================+
| Meters (0) | The port extension physical length is expressed in meters. |
+--------------+------------------------------------------------------------+
| Feet (1) | The port extension physical length is expressed in feet. |
+--------------+------------------------------------------------------------+
| Inches (2) | The port extension physical length is expressed in inches. |
+--------------+------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionDistanceUnit):
Specifies the unit of the port extension delay in physical length. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE_UNIT.value,
)
attr_val = enums.CorrectionPortExtensionDistanceUnit(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_distance_unit(self, selector_string, value):
r"""Sets the unit of the port extension delay in physical length. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure the same distance unit for all VNA ports.
The default value is **Meters**.
+--------------+------------------------------------------------------------+
| Name (Value) | Description |
+==============+============================================================+
| Meters (0) | The port extension physical length is expressed in meters. |
+--------------+------------------------------------------------------------+
| Feet (1) | The port extension physical length is expressed in feet. |
+--------------+------------------------------------------------------------+
| Inches (2) | The port extension physical length is expressed in inches. |
+--------------+------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionDistanceUnit, int):
Specifies the unit of the port extension delay in physical length. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
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
)
value = (
value.value if type(value) is enums.CorrectionPortExtensionDistanceUnit else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE_UNIT.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_velocity_factor(self, selector_string):
r"""Gets the speed of light in the port extension medium relative to speed of light in vacuum. Velocity Factor of 1
represents speed of light in vacuum. This attribute is used in conjuction with
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE` attribute to compute electrical delay.
This value is unitless. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure the same velocity factor for all VNA ports.
The default value is 1.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the speed of light in the port extension medium relative to speed of light in vacuum. Velocity Factor of 1
represents speed of light in vacuum. This attribute is used in conjuction with
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE` attribute to compute electrical delay.
This value is unitless. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_VELOCITY_FACTOR.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_velocity_factor(self, selector_string, value):
r"""Sets the speed of light in the port extension medium relative to speed of light in vacuum. Velocity Factor of 1
represents speed of light in vacuum. This attribute is used in conjuction with
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE` attribute to compute electrical delay.
This value is unitless. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure the same velocity factor for all VNA ports.
The default value is 1.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the speed of light in the port extension medium relative to speed of light in vacuum. Velocity Factor of 1
represents speed of light in vacuum. This attribute is used in conjuction with
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DISTANCE` attribute to compute electrical delay.
This value is unitless. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY_DOMAIN` attribute to **Distance**.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_VELOCITY_FACTOR.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_dc_loss_enabled(self, selector_string):
r"""Gets whether to compensate for the frequency-independent loss as part of the port extension. This attribute is
used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to
**True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **False**.
+--------------+------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==================================================================================================================+
| False (0) | The measurement disables the compensation of DC Loss of the port extension. |
+--------------+------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement compensates for the DC loss based on the value of |
| | Port Extension DC Loss (dB) specified by you. |
+--------------+------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionDCLossEnabled):
Specifies whether to compensate for the frequency-independent loss as part of the port extension. This attribute is
used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DC_LOSS_ENABLED.value,
)
attr_val = enums.CorrectionPortExtensionDCLossEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_dc_loss_enabled(self, selector_string, value):
r"""Sets whether to compensate for the frequency-independent loss as part of the port extension. This attribute is
used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to
**True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **False**.
+--------------+------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==================================================================================================================+
| False (0) | The measurement disables the compensation of DC Loss of the port extension. |
+--------------+------------------------------------------------------------------------------------------------------------------+
| True (1) | The measurement compensates for the DC loss based on the value of |
| | Port Extension DC Loss (dB) specified by you. |
+--------------+------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionDCLossEnabled, int):
Specifies whether to compensate for the frequency-independent loss as part of the port extension. This attribute is
used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_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
)
value = (
value.value if type(value) is enums.CorrectionPortExtensionDCLossEnabled else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DC_LOSS_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_loss_dc_loss(self, selector_string):
r"""Gets the frequency-independent loss to compensate as part of the port extension. This attribute is used only when
you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True**. This
value is expressed in dB.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same value of DC loss for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency-independent loss to compensate as part of the port extension. This attribute is used only when
you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DC_LOSS.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_loss_dc_loss(self, selector_string, value):
r"""Sets the frequency-independent loss to compensate as part of the port extension. This attribute is used only when
you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True**. This
value is expressed in dB.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same value of DC loss for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency-independent loss to compensate as part of the port extension. This attribute is used only when
you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True**. This
value is expressed in dB.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_DC_LOSS.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_loss1_enabled(self, selector_string):
r"""Gets whether to compensate for the frequency-dependent loss, Loss1, as part of the port extension. This attribute
is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute
to **True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+========================================================================================================+
| False (0) | The measurement disables the compensation of Loss1 of the port extension. |
+--------------+--------------------------------------------------------------------------------------------------------+
| True (1) | The measurement compensates for the Loss1 based on the configured value of |
| | Port Extension Loss1 (dB). |
+--------------+--------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionLoss1Enabled):
Specifies whether to compensate for the frequency-dependent loss, Loss1, as part of the port extension. This attribute
is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED.value,
)
attr_val = enums.CorrectionPortExtensionLoss1Enabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_loss1_enabled(self, selector_string, value):
r"""Sets whether to compensate for the frequency-dependent loss, Loss1, as part of the port extension. This attribute
is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute
to **True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+========================================================================================================+
| False (0) | The measurement disables the compensation of Loss1 of the port extension. |
+--------------+--------------------------------------------------------------------------------------------------------+
| True (1) | The measurement compensates for the Loss1 based on the configured value of |
| | Port Extension Loss1 (dB). |
+--------------+--------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionLoss1Enabled, int):
Specifies whether to compensate for the frequency-dependent loss, Loss1, as part of the port extension. This attribute
is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_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
)
value = (
value.value if type(value) is enums.CorrectionPortExtensionLoss1Enabled else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_loss1_frequency(self, selector_string):
r"""Gets the frequency at which Loss1 is applied and compensated. This attribute is used only when the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute is set to **True** and the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True**. This
value is expressed in Hz.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure Loss1 Frequency for all VNA ports.
The default value is 0 Hz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency at which Loss1 is applied and compensated. This attribute is used only when the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute is set to **True** and the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_FREQUENCY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_loss1_frequency(self, selector_string, value):
r"""Sets the frequency at which Loss1 is applied and compensated. This attribute is used only when the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute is set to **True** and the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True**. This
value is expressed in Hz.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure Loss1 Frequency for all VNA ports.
The default value is 0 Hz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency at which Loss1 is applied and compensated. This attribute is used only when the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute is set to **True** and the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True**. This
value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_FREQUENCY.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_loss1(self, selector_string):
r"""Gets the frequency-dependent loss, Loss1 in dB, to compensate as part of port extension.
If the DC loss and one additional frequency loss, Loss1 at the frequency F1 is known, the total loss at
frequency f can be approximated by:
L (f) = DC Loss + ((Loss1 - DC Loss) x (f / f1)^0.5)
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True**. This
value is expressed in dB.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same value of Loss1 for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency-dependent loss, Loss1 in dB, to compensate as part of port extension.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_loss1(self, selector_string, value):
r"""Sets the frequency-dependent loss, Loss1 in dB, to compensate as part of port extension.
If the DC loss and one additional frequency loss, Loss1 at the frequency F1 is known, the total loss at
frequency f can be approximated by:
L (f) = DC Loss + ((Loss1 - DC Loss) x (f / f1)^0.5)
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True** and the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True**. This
value is expressed in dB.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same value of Loss1 for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency-dependent loss, Loss1 in dB, to compensate as part of port extension.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_loss2_enabled(self, selector_string):
r"""Gets whether to compensate for the frequency-dependent loss, Loss2, as part of the port extension. This attribute
is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute
to **True** and the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is
set to **True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+========================================================================================================+
| False (0) | The measurement disables the compensation of Loss2 of the port extension. |
+--------------+--------------------------------------------------------------------------------------------------------+
| True (1) | The measurement compensates for the Loss2 based on the configured value of |
| | Port Extension Loss2 (dB). |
+--------------+--------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionLoss2Enabled):
Specifies whether to compensate for the frequency-dependent loss, Loss2, as part of the port extension. This attribute
is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute
to **True** and the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_ENABLED.value,
)
attr_val = enums.CorrectionPortExtensionLoss2Enabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_loss2_enabled(self, selector_string, value):
r"""Sets whether to compensate for the frequency-dependent loss, Loss2, as part of the port extension. This attribute
is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute
to **True** and the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is
set to **True**.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure for all VNA ports.
The default value is **False**.
+--------------+--------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+========================================================================================================+
| False (0) | The measurement disables the compensation of Loss2 of the port extension. |
+--------------+--------------------------------------------------------------------------------------------------------+
| True (1) | The measurement compensates for the Loss2 based on the configured value of |
| | Port Extension Loss2 (dB). |
+--------------+--------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionLoss2Enabled, int):
Specifies whether to compensate for the frequency-dependent loss, Loss2, as part of the port extension. This attribute
is used only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute
to **True** and the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is
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
)
value = (
value.value if type(value) is enums.CorrectionPortExtensionLoss2Enabled else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_loss2_frequency(self, selector_string):
r"""Gets the frequency at which Loss2 is applied and compensated. This attribute is used only when the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute is set to **True**, the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True** and
the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_ENABLED` attribute is set to **True**.
This value is expressed in Hz.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure Loss2 Frequency for all VNA ports.
The default value is 0 Hz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency at which Loss2 is applied and compensated. This attribute is used only when the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute is set to **True**, the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True** and
the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_ENABLED` attribute is set to **True**.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_FREQUENCY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_loss2_frequency(self, selector_string, value):
r"""Sets the frequency at which Loss2 is applied and compensated. This attribute is used only when the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute is set to **True**, the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True** and
the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_ENABLED` attribute is set to **True**.
This value is expressed in Hz.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure Loss2 Frequency for all VNA ports.
The default value is 0 Hz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency at which Loss2 is applied and compensated. This attribute is used only when the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute is set to **True**, the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True** and
the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_ENABLED` attribute is set to **True**.
This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_FREQUENCY.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_loss2(self, selector_string):
r"""Gets the frequency-dependent loss, Loss2 in dB, to compensate as part of the port extension.
If in addition to the DC loss and frequency-dependent loss at one frequency (Loss1 at the frequency f1), the
loss at a second frequency, Loss2 at frequency f2 is also known, the total loss at frequency f can be approximated by:
L (f) = DC Loss + ((Loss1 - DC Loss) x (f / f1)^b)
, where b = log[(abs((Loss1 - DC Loss) / (Loss2 - DC Loss)))] / log(f1 / f2)
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True**, the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True** and
the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_ENABLED` attribute is set to **True**.
This value is expressed in dB.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same value of Loss2 for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the frequency-dependent loss, Loss2 in dB, to compensate as part of the port extension.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_loss2(self, selector_string, value):
r"""Sets the frequency-dependent loss, Loss2 in dB, to compensate as part of the port extension.
If in addition to the DC loss and frequency-dependent loss at one frequency (Loss1 at the frequency f1), the
loss at a second frequency, Loss2 at frequency f2 is also known, the total loss at frequency f can be approximated by:
L (f) = DC Loss + ((Loss1 - DC Loss) x (f / f1)^b)
, where b = log[(abs((Loss1 - DC Loss) / (Loss2 - DC Loss)))] / log(f1 / f2)
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_ENABLED` attribute to **True**, the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1_ENABLED` attribute is set to **True** and
the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2_ENABLED` attribute is set to **True**.
This value is expressed in dB.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same value of Loss2 for all VNA ports.
The default value is 0 dB.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the frequency-dependent loss, Loss2 in dB, to compensate as part of the port extension.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_auto_loss_enabled(self, selector_string):
r"""Gets whether to determine both the frequency-dependent losses (Loss1 and Loss2) and the frequency-independent loss
(DC Loss) during automatic port extension.
Typically, the frequencies located at one-quarter and three-quarters of the configured sweep range are used as
the f1 and f2 values.
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) | Disable the loss estimation in automatic port extension. |
+--------------+----------------------------------------------------------+
| True (1) | Enable the loss estimation in automatic port extension. |
+--------------+----------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionAutoLossEnabled):
Specifies whether to determine both the frequency-dependent losses (Loss1 and Loss2) and the frequency-independent loss
(DC Loss) during automatic port extension.
Typically, the frequencies located at one-quarter and three-quarters of the configured sweep range are used as
the f1 and f2 values.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_LOSS_ENABLED.value,
)
attr_val = enums.CorrectionPortExtensionAutoLossEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_auto_loss_enabled(self, selector_string, value):
r"""Sets whether to determine both the frequency-dependent losses (Loss1 and Loss2) and the frequency-independent loss
(DC Loss) during automatic port extension.
Typically, the frequencies located at one-quarter and three-quarters of the configured sweep range are used as
the f1 and f2 values.
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) | Disable the loss estimation in automatic port extension. |
+--------------+----------------------------------------------------------+
| True (1) | Enable the loss estimation in automatic port extension. |
+--------------+----------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionAutoLossEnabled, int):
Specifies whether to determine both the frequency-dependent losses (Loss1 and Loss2) and the frequency-independent loss
(DC Loss) during automatic port extension.
Typically, the frequencies located at one-quarter and three-quarters of the configured sweep range are used as
the f1 and f2 values.
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
)
value = (
value.value
if type(value) is enums.CorrectionPortExtensionAutoLossEnabled
else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_LOSS_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_auto_regularization_enabled(self, selector_string):
r"""Gets whether the compensated trace should be regularized to ensure it remains at or below 0 dB. Fixture mismatch
can sometimes cause S11 or S22 measurements to exceed 0 dB, which may introduce numerical instability when using the
resulting S-parameters.
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_LOSS_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 **True**.
+--------------+----------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==================================================================================+
| False (0) | Disable the regularization of the compensated trace in automatic port extension. |
+--------------+----------------------------------------------------------------------------------+
| True (1) | Enable the regularization of the compensated trace in automatic port extension. |
+--------------+----------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionAutoRegularizationEnabled):
Specifies whether the compensated trace should be regularized to ensure it remains at or below 0 dB. Fixture mismatch
can sometimes cause S11 or S22 measurements to exceed 0 dB, which may introduce numerical instability when using the
resulting S-parameters.
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_LOSS_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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_REGULARIZATION_ENABLED.value,
)
attr_val = enums.CorrectionPortExtensionAutoRegularizationEnabled(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_auto_regularization_enabled(self, selector_string, value):
r"""Sets whether the compensated trace should be regularized to ensure it remains at or below 0 dB. Fixture mismatch
can sometimes cause S11 or S22 measurements to exceed 0 dB, which may introduce numerical instability when using the
resulting S-parameters.
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_LOSS_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 **True**.
+--------------+----------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==================================================================================+
| False (0) | Disable the regularization of the compensated trace in automatic port extension. |
+--------------+----------------------------------------------------------------------------------+
| True (1) | Enable the regularization of the compensated trace in automatic port extension. |
+--------------+----------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionAutoRegularizationEnabled, int):
Specifies whether the compensated trace should be regularized to ensure it remains at or below 0 dB. Fixture mismatch
can sometimes cause S11 or S22 measurements to exceed 0 dB, which may introduce numerical instability when using the
resulting S-parameters.
This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_LOSS_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
)
value = (
value.value
if type(value) is enums.CorrectionPortExtensionAutoRegularizationEnabled
else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_REGULARIZATION_ENABLED.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_auto_frequency_mode(self, selector_string):
r"""Gets the frequency mode over which the delay and loss (optional) values are determined.
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 **Sweep**.
+--------------+----------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================+
| Sweep (0) | Sets the frequency mode to Sweep. Configured sweep range is used to determine the phase and loss values. |
+--------------+----------------------------------------------------------------------------------------------------------+
| User (1) | Sets the frequency mode to User Span. User-defined span is used to determine the phase and loss values. |
+--------------+----------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionPortExtensionAutoFrequencyMode):
Specifies the frequency mode over which the delay and loss (optional) values are determined.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE.value,
)
attr_val = enums.CorrectionPortExtensionAutoFrequencyMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_auto_frequency_mode(self, selector_string, value):
r"""Sets the frequency mode over which the delay and loss (optional) values are determined.
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 **Sweep**.
+--------------+----------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================+
| Sweep (0) | Sets the frequency mode to Sweep. Configured sweep range is used to determine the phase and loss values. |
+--------------+----------------------------------------------------------------------------------------------------------+
| User (1) | Sets the frequency mode to User Span. User-defined span is used to determine the phase and loss values. |
+--------------+----------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionPortExtensionAutoFrequencyMode, int):
Specifies the frequency mode over which the delay and loss (optional) values are determined.
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
)
value = (
value.value
if type(value) is enums.CorrectionPortExtensionAutoFrequencyMode
else value
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_auto_start_frequency(self, selector_string):
r"""Gets the start frequency of the user span. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE` attribute to **User Span**.
This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 1 GHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the start frequency of the user span. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE` attribute to **User Span**.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_START_FREQUENCY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_auto_start_frequency(self, selector_string, value):
r"""Sets the start frequency of the user span. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE` attribute to **User Span**.
This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 1 GHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the start frequency of the user span. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE` attribute to **User Span**.
This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_START_FREQUENCY.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_port_extension_auto_stop_frequency(self, selector_string):
r"""Gets the stop frequency of the user span. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE` attribute to **User Span**.
This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 2 GHz.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the stop frequency of the user span. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE` attribute to **User Span**.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_STOP_FREQUENCY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_port_extension_auto_stop_frequency(self, selector_string, value):
r"""Sets the stop frequency of the user span. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE` attribute to **User Span**.
This value is expressed in Hz.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
The default value is 2 GHz.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the stop frequency of the user span. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_FREQUENCY_MODE` attribute to **User Span**.
This value is expressed in Hz.
Returns:
int:
Returns the status code of this method. The status code either indicates success or describes a warning condition.
"""
try:
self._session_function_lock.enter_read_lock()
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_PORT_EXTENSION_AUTO_STOP_FREQUENCY.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_connector_type(self, selector_string):
r"""Gets the connector type of the DUT. The specified connector type must be supported by the calkit that you selected
for calibration.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same connector type for VNA ports.
The default value is an empty string.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the connector type of the DUT. The specified connector type must be supported by the calkit that you selected
for calibration.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CONNECTOR_TYPE.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_connector_type(self, selector_string, value):
r"""Sets the connector type of the DUT. The specified connector type must be supported by the calkit that you selected
for calibration.
Use "port::<*portname*>" as the selector string to configure or read this attribute for a specific VNA port.
Use "port::all" to configure same connector type for VNA ports.
The default value is an empty string.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the connector type of the DUT. The specified connector type must be supported by the calkit that you selected
for calibration.
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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CONNECTOR_TYPE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_calkit_type(self, selector_string):
r"""Gets the type of calkit used for calibration.
Use "port::all" as the selector string to specify the same calkit type for all VNA ports. Use
"port::<*portname*>" as the selector string to read this attribute for a specific VNA port.
.. note::
Note that, currently, RFmxVNA only supports the use of same calkit type (and the same calkit) for all calibration ports
in a guided calibration procedure.
The default value is **Electronic**.
+----------------+----------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+================+==========================================================================================================+
| Electronic (0) | Perform calibration using an electronic calkit module. Supported Electronic Calkit Modules: NI CAL-5501. |
+----------------+----------------------------------------------------------------------------------------------------------+
| Mechanical (1) | Perform calibration using discrete cal standards from a mechanical calkit. |
+----------------+----------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionCalibrationCalkitType):
Specifies the type of calkit used for calibration.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE.value,
)
attr_val = enums.CorrectionCalibrationCalkitType(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_calkit_type(self, selector_string, value):
r"""Sets the type of calkit used for calibration.
Use "port::all" as the selector string to specify the same calkit type for all VNA ports. Use
"port::<*portname*>" as the selector string to read this attribute for a specific VNA port.
.. note::
Note that, currently, RFmxVNA only supports the use of same calkit type (and the same calkit) for all calibration ports
in a guided calibration procedure.
The default value is **Electronic**.
+----------------+----------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+================+==========================================================================================================+
| Electronic (0) | Perform calibration using an electronic calkit module. Supported Electronic Calkit Modules: NI CAL-5501. |
+----------------+----------------------------------------------------------------------------------------------------------+
| Mechanical (1) | Perform calibration using discrete cal standards from a mechanical calkit. |
+----------------+----------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionCalibrationCalkitType, int):
Specifies the type of calkit used for calibration.
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
)
value = value.value if type(value) is enums.CorrectionCalibrationCalkitType else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_calkit_electronic_resource_name(self, selector_string):
r"""Gets the resource name of the electronic calibration module (vCal) used for calibration. This attribute is used
only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute to
**Electronic**.
**Supported Electronic Calkit Modules**: NI CAL-5501
Use "port::all" as the selector string to specify the same resource name for all VNA ports. Use
"port::<*portname*>" as the selector string to read this attribute for a specific VNA port.
.. note::
Currently, RFmxVNA only supports the use of same calkit type (and the same calkit) for all calibration ports in a
guided calibration procedure.
The default value is an empty string.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the resource name of the electronic calibration module (vCal) used for calibration. This attribute is used
only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute to
**Electronic**.
**Supported Electronic Calkit Modules**: NI CAL-5501
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_ELECTRONIC_RESOURCE_NAME.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_calkit_electronic_resource_name(self, selector_string, value):
r"""Sets the resource name of the electronic calibration module (vCal) used for calibration. This attribute is used
only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute to
**Electronic**.
**Supported Electronic Calkit Modules**: NI CAL-5501
Use "port::all" as the selector string to specify the same resource name for all VNA ports. Use
"port::<*portname*>" as the selector string to read this attribute for a specific VNA port.
.. note::
Currently, RFmxVNA only supports the use of same calkit type (and the same calkit) for all calibration ports in a
guided calibration procedure.
The default value is an empty string.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the resource name of the electronic calibration module (vCal) used for calibration. This attribute is used
only when you set the :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute to
**Electronic**.
**Supported Electronic Calkit Modules**: NI CAL-5501
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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_ELECTRONIC_RESOURCE_NAME.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_calkit_electronic_orientation(self, selector_string):
r"""Gets the orientation of the vCal fixture ports with respect to vCal ports.
Use "portA:portname, portB:portname" format to specify vCal orientation.
When using NI-PXIe 5633 without an NI switch module, if vCal orientation is not specified, it is assumed to be
"portA:port1, portB:port2".
When using NI-PXIe 5633 with an NI switch module, you must set vCal orientation for all the specified
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_PORTS`.
The default value is an empty string.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the orientation of the vCal fixture ports with respect to vCal ports.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_ELECTRONIC_ORIENTATION.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_calkit_electronic_orientation(self, selector_string, value):
r"""Sets the orientation of the vCal fixture ports with respect to vCal ports.
Use "portA:portname, portB:portname" format to specify vCal orientation.
When using NI-PXIe 5633 without an NI switch module, if vCal orientation is not specified, it is assumed to be
"portA:port1, portB:port2".
When using NI-PXIe 5633 with an NI switch module, you must set vCal orientation for all the specified
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_PORTS`.
The default value is an empty string.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the orientation of the vCal fixture ports with respect to vCal ports.
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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_ELECTRONIC_ORIENTATION.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_calkit_mechanical_name(self, selector_string):
r"""Gets the name of the mechanical calkit used for calibration. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute to **Mechanical**.
You must set a valid calkit name. Use :py:meth:`calkit_manager_get_calkit_ids` method to get list of available
mechanical calkits.
.. note::
Currently, RFmxVNA only supports the use of same calkit type and same calkit name for all calibration ports in a guided
calibration procedure.
Use "port::all" as the selector string to specify the same calkit name for all VNA ports. Use
"port::<*portname*>" as the selector string to read this attribute for a specific VNA port.
The default value is an empty string.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the name of the mechanical calkit used for calibration. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute to **Mechanical**.
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_MECHANICAL_NAME.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_calkit_mechanical_name(self, selector_string, value):
r"""Sets the name of the mechanical calkit used for calibration. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute to **Mechanical**.
You must set a valid calkit name. Use :py:meth:`calkit_manager_get_calkit_ids` method to get list of available
mechanical calkits.
.. note::
Currently, RFmxVNA only supports the use of same calkit type and same calkit name for all calibration ports in a guided
calibration procedure.
Use "port::all" as the selector string to specify the same calkit name for all VNA ports. Use
"port::<*portname*>" as the selector string to read this attribute for a specific VNA port.
The default value is an empty string.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the name of the mechanical calkit used for calibration. This attribute is used only when you set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute to **Mechanical**.
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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_MECHANICAL_NAME.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_method(self, selector_string):
r"""Gets the calibration method.
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 **SOL**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| SOL (0) | Full 1-port calibration using atleast three distinct reflection standards, typically named Short, Open and Load. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| SOLT (1) | Full 2-port calibration by performing two SOL calibrations on the two ports using atleast three distinct reflection |
| | standards, and a Thru cal using a transmission standard connecting the two ports. Use Thru Method attribute to select a |
| | suitable Thru cal procedure. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| TRL (2) | Full 2-port calibration using a Thru, at least one Line, and one Reflect standard (Thru-Reflect-Line). The Thru |
| | standard can be an flush Thru or can have non-zero length (LRL, Line-Reflect-Line). The Reflect standard has to be |
| | identical for both ports. If multiple lines with different lengths are defined, the measurement automatically splits |
| | the measurement frequency range into segments and picks the line standard with appropriate length for each segment. The |
| | reference impedance of the calibration is the characteristic impedance of the Line(s). |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionCalibrationMethod):
Specifies the calibration method.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.CORRECTION_CALIBRATION_METHOD.value
)
attr_val = enums.CorrectionCalibrationMethod(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_method(self, selector_string, value):
r"""Sets the calibration method.
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 **SOL**.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| SOL (0) | Full 1-port calibration using atleast three distinct reflection standards, typically named Short, Open and Load. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| SOLT (1) | Full 2-port calibration by performing two SOL calibrations on the two ports using atleast three distinct reflection |
| | standards, and a Thru cal using a transmission standard connecting the two ports. Use Thru Method attribute to select a |
| | suitable Thru cal procedure. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| TRL (2) | Full 2-port calibration using a Thru, at least one Line, and one Reflect standard (Thru-Reflect-Line). The Thru |
| | standard can be an flush Thru or can have non-zero length (LRL, Line-Reflect-Line). The Reflect standard has to be |
| | identical for both ports. If multiple lines with different lengths are defined, the measurement automatically splits |
| | the measurement frequency range into segments and picks the line standard with appropriate length for each segment. The |
| | reference impedance of the calibration is the characteristic impedance of the Line(s). |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionCalibrationMethod, int):
Specifies the calibration method.
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
)
value = value.value if type(value) is enums.CorrectionCalibrationMethod else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_METHOD.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_thru_method(self, selector_string):
r"""Gets the Thru calibration method when :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_METHOD`
attribute is set to **SOLT**.
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 **Auto**.
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============================+==========================================================================================================================+
| Auto (0) | Measurement selects the appropriate Thru calibration method based on the value you specified for Calkit Type attribute. |
| | If Calkit Type is Electronic, then Delay Thru Using Defined Thru is selected. If Calkit Type is Mechanical, then |
| | Undefined Thru is selected. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Defined Thru (1) | The Thru definition from calkit definition is used based on the value you specified for Calkit Type attribute. If |
| | Calkit Type is Electronic, the Thru definition from the electronic calkit EPROM is used. If Calkit Type is Mechanical, |
| | the Thru definition from the calkit definition file is used. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Flush Thru (2) | Indicates a direct connection of the test ports when Calkit Type is Mechanical. The measured Thru is treated as flush |
| | Thru ignoring the Thru definition from the Calkit file. This method is not supported when Calkit Type is Electronic. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Undefined Thru (3) | Indicates connection of a Thru without a stored definition when Calkit Type is Mechanical. The measured Thru is treated |
| | as unknown Thru ignoring the Thru definition from the Calkit file. If a delay is configured, the delay will be utilized |
| | for the calibration. This method is not supported when Calkit Type is Electronic. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| vCal Thru as Unknown Thru (5) | The Thru from the electronical Calkit is used for Thru measurement during calibration. The Thru definirion from vCal |
| | EPROM is used as a phase reference for the Thru characterization during calibration. |
| | This method is not supported when Calkit Type is Mechanical. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.CorrectionCalibrationThruMethod):
Specifies the Thru calibration method when :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_METHOD`
attribute is set to **SOLT**.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_THRU_METHOD.value,
)
attr_val = enums.CorrectionCalibrationThruMethod(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_thru_method(self, selector_string, value):
r"""Sets the Thru calibration method when :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_METHOD`
attribute is set to **SOLT**.
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 **Auto**.
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============================+==========================================================================================================================+
| Auto (0) | Measurement selects the appropriate Thru calibration method based on the value you specified for Calkit Type attribute. |
| | If Calkit Type is Electronic, then Delay Thru Using Defined Thru is selected. If Calkit Type is Mechanical, then |
| | Undefined Thru is selected. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Defined Thru (1) | The Thru definition from calkit definition is used based on the value you specified for Calkit Type attribute. If |
| | Calkit Type is Electronic, the Thru definition from the electronic calkit EPROM is used. If Calkit Type is Mechanical, |
| | the Thru definition from the calkit definition file is used. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Flush Thru (2) | Indicates a direct connection of the test ports when Calkit Type is Mechanical. The measured Thru is treated as flush |
| | Thru ignoring the Thru definition from the Calkit file. This method is not supported when Calkit Type is Electronic. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| Undefined Thru (3) | Indicates connection of a Thru without a stored definition when Calkit Type is Mechanical. The measured Thru is treated |
| | as unknown Thru ignoring the Thru definition from the Calkit file. If a delay is configured, the delay will be utilized |
| | for the calibration. This method is not supported when Calkit Type is Electronic. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| vCal Thru as Unknown Thru (5) | The Thru from the electronical Calkit is used for Thru measurement during calibration. The Thru definirion from vCal |
| | EPROM is used as a phase reference for the Thru characterization during calibration. |
| | This method is not supported when Calkit Type is Mechanical. |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.CorrectionCalibrationThruMethod, int):
Specifies the Thru calibration method when :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_METHOD`
attribute is set to **SOLT**.
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
)
value = value.value if type(value) is enums.CorrectionCalibrationThruMethod else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_THRU_METHOD.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_thru_coax_delay(self, selector_string):
r"""Gets the delay of the Thru mechanical standard when
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute is set to **Mechanical** and
Thru Method attribute is set to **Auto** or **Undefined Thru**. This value is expressed in seconds.
Use this attribute to specify an approximate delay value of an unknown-thru cal standard. Measurement uses this
value to eliminate the uncertainty of ± 180 degrees in the estimated phase response of the Thru.
If you set this attribute to 0, the VNA automatically determines the delay of the Thru. You only need to set
this attribute to an approximate non-zero delay value when Max Frequency Step Size > 1/(2 x Thru Delay). Here,
Frequency Step Size refers to the difference between 2 consecutive frequency points in the set of frequencies sorted in
ascending order.
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 s.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Specifies the delay of the Thru mechanical standard when
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute is set to **Mechanical** and
Thru Method attribute is set to **Auto** or **Undefined Thru**. 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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_THRU_COAX_DELAY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_thru_coax_delay(self, selector_string, value):
r"""Sets the delay of the Thru mechanical standard when
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute is set to **Mechanical** and
Thru Method attribute is set to **Auto** or **Undefined Thru**. This value is expressed in seconds.
Use this attribute to specify an approximate delay value of an unknown-thru cal standard. Measurement uses this
value to eliminate the uncertainty of ± 180 degrees in the estimated phase response of the Thru.
If you set this attribute to 0, the VNA automatically determines the delay of the Thru. You only need to set
this attribute to an approximate non-zero delay value when Max Frequency Step Size > 1/(2 x Thru Delay). Here,
Frequency Step Size refers to the difference between 2 consecutive frequency points in the set of frequencies sorted in
ascending order.
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 s.
Args:
selector_string (string):
Pass an empty string.
value (float):
Specifies the delay of the Thru mechanical standard when
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` attribute is set to **Mechanical** and
Thru Method attribute is set to **Auto** or **Undefined Thru**. 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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_THRU_COAX_DELAY.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_step_count(self, selector_string):
r"""Gets the total number of manual connection steps required to perform the selected calibration routine.
For example, if you use NI CAL-5501 electronic calkit to calibrate NI PXIe-5633 by using SOLT calibration
method, querying this attribute will return 1, indicating that you only need to perform 1 manual connection to complete
the SOLT cal. Similarly, if you calibrate the same system using a mechanical calkit containing a Short, Open, Load and
Thru discrete cal standards, then querying this attribute will return 7, indicating that you must perform 7 distinct
manual connections to complete the SOLT cal.
You must configure all the calibration related attributes and call :py:meth:`calibration_initiate` method
before you query this 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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (int):
Returns the total number of manual connection steps required to perform the selected calibration routine.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_STEP_COUNT.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_correction_calibration_step_count(self, selector_string, value):
r"""Sets the total number of manual connection steps required to perform the selected calibration routine.
For example, if you use NI CAL-5501 electronic calkit to calibrate NI PXIe-5633 by using SOLT calibration
method, querying this attribute will return 1, indicating that you only need to perform 1 manual connection to complete
the SOLT cal. Similarly, if you calibrate the same system using a mechanical calkit containing a Short, Open, Load and
Thru discrete cal standards, then querying this attribute will return 7, indicating that you must perform 7 distinct
manual connections to complete the SOLT cal.
You must configure all the calibration related attributes and call :py:meth:`calibration_initiate` method
before you query this 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.
Args:
selector_string (string):
Pass an empty string.
value (int):
Returns the total number of manual connection steps required to perform the selected calibration routine.
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
)
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_STEP_COUNT.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_step_description(self, selector_string):
r"""Gets the description for the specified calibration step. You can use the description for each calibration step to
determine which mechanical cal standard or electronic calkit module should you connect to which VNA port(s).
Use "calstep<*n*>" as the selector string to read this attribute.
You must configure all the calibration related attributes and call :py:meth:`calibration_initiate` method
before you query this attribute.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Returns the description for the specified calibration step. You can use the description for each calibration step to
determine which mechanical cal standard or electronic calkit module should you connect to which VNA port(s).
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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_STEP_DESCRIPTION.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def get_correction_calibration_estimated_thru_delay(self, selector_string):
r"""Gets the estimated Thru Delay when Thru Method is set to **Undefined Thru**.
You do not need to use a selector string to configure or read this attribute for the default signal instance.
Refer to the `Selector String <https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ topic for
information about the string syntax for named signals.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (float):
Returns the estimated Thru Delay when Thru Method is set to **Undefined Thru**.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_ESTIMATED_THRU_DELAY.value,
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def get_limited_configuration_change(self, selector_string):
r"""Gets the set of attributes that are considered by NI-RFmx in the locked signal configuration state.
If your test system performs the same measurement repeatedly, enabling this attribute will help achieve faster
measurements. When you set this attribute to a value other than Disabled, the RFmx driver will use an optimized code
path and skip some checks.
You can also use this attribute to lock a specific instrument configuration for a signal so that every time
that you initiate the signal, RFmx applies the RFmxInstr attributes from a locked configuration.
NI recommends you use this attribute in conjunction with named signal configurations. Create named signal
configurations for each measurement configuration in your test program and set this attribute to a value other than
Disabled for one or more of the named signal configurations. This allows RFmx to precompute the acquisition settings
for your measurement configurations and re-use the precomputed settings each time you initiate the measurement. You do
not need to use this attribute if you create named signals for all the measurement configurations in your test program
during test sequence initialization and do not change any RFInstr or personality attributes while testing each device
under test. RFmx automatically optimizes that use case.
Specify the named signal configuration you are setting this attribute in the `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ input.
The default value is **Disabled**.
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==========================================================================================================================+
| Disabled (0) | This is the normal mode of RFmx operation. All configuration changes in RFmxInstr attributes or RFmxVNA attributes will |
| | be applied during RFmx Commit. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| No Change (1) | Signal configuration and RFmxInstr configuration are locked after the first Commit or Initiate of the named signal |
| | configuration. Any configuration change thereafter either in RFmxInstr attributes or personality attributes will not be |
| | considered by subsequent RFmx Commits or Initiates of this signal. Use No Change if you have created named signal |
| | configurations for all measurement configurations but are setting some RFmxInstr attributes. Refer to the Limitations |
| | of the Limited Configuration Change Property topic for more details about the limitations of using this mode. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.LimitedConfigurationChange):
Specifies the set of attributes that are considered by NI-RFmx in the locked signal configuration state.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.LIMITED_CONFIGURATION_CHANGE.value
)
attr_val = enums.LimitedConfigurationChange(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_limited_configuration_change(self, selector_string, value):
r"""Sets the set of attributes that are considered by NI-RFmx in the locked signal configuration state.
If your test system performs the same measurement repeatedly, enabling this attribute will help achieve faster
measurements. When you set this attribute to a value other than Disabled, the RFmx driver will use an optimized code
path and skip some checks.
You can also use this attribute to lock a specific instrument configuration for a signal so that every time
that you initiate the signal, RFmx applies the RFmxInstr attributes from a locked configuration.
NI recommends you use this attribute in conjunction with named signal configurations. Create named signal
configurations for each measurement configuration in your test program and set this attribute to a value other than
Disabled for one or more of the named signal configurations. This allows RFmx to precompute the acquisition settings
for your measurement configurations and re-use the precomputed settings each time you initiate the measurement. You do
not need to use this attribute if you create named signals for all the measurement configurations in your test program
during test sequence initialization and do not change any RFInstr or personality attributes while testing each device
under test. RFmx automatically optimizes that use case.
Specify the named signal configuration you are setting this attribute in the `Selector String
<https://www.ni.com/docs/en-US/bundle/rfmx/page/selector-strings-net.html>`_ input.
The default value is **Disabled**.
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===============+==========================================================================================================================+
| Disabled (0) | This is the normal mode of RFmx operation. All configuration changes in RFmxInstr attributes or RFmxVNA attributes will |
| | be applied during RFmx Commit. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
| No Change (1) | Signal configuration and RFmxInstr configuration are locked after the first Commit or Initiate of the named signal |
| | configuration. Any configuration change thereafter either in RFmxInstr attributes or personality attributes will not be |
| | considered by subsequent RFmx Commits or Initiates of this signal. Use No Change if you have created named signal |
| | configurations for all measurement configurations but are setting some RFmxInstr attributes. Refer to the Limitations |
| | of the Limited Configuration Change Property topic for more details about the limitations of using this mode. |
+---------------+--------------------------------------------------------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.LimitedConfigurationChange, int):
Specifies the set of attributes that are considered by NI-RFmx in the locked signal configuration state.
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
)
value = value.value if type(value) is enums.LimitedConfigurationChange else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string,
attributes.AttributeID.LIMITED_CONFIGURATION_CHANGE.value,
value,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_source_power_mode(self, selector_string):
r"""Gets whether to make VNA measurements with source turned off.
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 **Auto**.
+--------------+--------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================+
| Auto (0) | The source is turned on when making the measurement. |
+--------------+--------------------------------------------------------------------------+
| Off (1) | The source is turned off for all the ports when making the measurements. |
+--------------+--------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (enums.SourcePowerMode):
Specifies whether to make VNA measurements with source turned off.
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
)
attr_val, error_code = self._interpreter.get_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SOURCE_POWER_MODE.value
)
attr_val = enums.SourcePowerMode(attr_val)
except (KeyError, ValueError):
raise errors.DriverTooNewError() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_source_power_mode(self, selector_string, value):
r"""Sets whether to make VNA measurements with source turned off.
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 **Auto**.
+--------------+--------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================+
| Auto (0) | The source is turned on when making the measurement. |
+--------------+--------------------------------------------------------------------------+
| Off (1) | The source is turned off for all the ports when making the measurements. |
+--------------+--------------------------------------------------------------------------+
Args:
selector_string (string):
Pass an empty string.
value (enums.SourcePowerMode, int):
Specifies whether to make VNA measurements with source turned off.
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
)
value = value.value if type(value) is enums.SourcePowerMode else value
error_code = self._interpreter.set_attribute_i32( # type: ignore
updated_selector_string, attributes.AttributeID.SOURCE_POWER_MODE.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_ground_terminated_ports(self, selector_string):
r"""Gets the selection of ports to be ground terminated in case of SM2 devices. The ports passed to this attribute
will be mutually exclusive to the ports passed to the Selected Ports 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.
Args:
selector_string (string):
Pass an empty string.
Returns:
Tuple (attr_val, error_code):
attr_val (string):
Specifies the selection of ports to be ground terminated in case of SM2 devices. The ports passed to this attribute
will be mutually exclusive to the ports passed to the Selected Ports 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
)
attr_val, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string, attributes.AttributeID.GROUND_TERMINATED_PORTS.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_ground_terminated_ports(self, selector_string, value):
r"""Sets the selection of ports to be ground terminated in case of SM2 devices. The ports passed to this attribute
will be mutually exclusive to the ports passed to the Selected Ports 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.
Args:
selector_string (string):
Pass an empty string.
value (string):
Specifies the selection of ports to be ground terminated in case of SM2 devices. The ports passed to this attribute
will be mutually exclusive to the ports passed to the Selected Ports 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
)
_helper.validate_not_none(value, "value")
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string, attributes.AttributeID.GROUND_TERMINATED_PORTS.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_result_fetch_timeout(self, selector_string):
r"""Gets the time, in seconds, to wait before results are available. Set this value to a time longer than expected for
fetching the measurement. A value of -1 specifies that the RFmxVNA waits until the measurement is complete.
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 time, in seconds, to wait before results are available. Set this value to a time longer than expected for
fetching the measurement. A value of -1 specifies that the RFmxVNA waits until the measurement is complete.
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
)
attr_val, error_code = self._interpreter.get_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.RESULT_FETCH_TIMEOUT.value
)
finally:
self._session_function_lock.exit_read_lock()
return attr_val, error_code
@_raise_if_disposed
def set_result_fetch_timeout(self, selector_string, value):
r"""Sets the time, in seconds, to wait before results are available. Set this value to a time longer than expected for
fetching the measurement. A value of -1 specifies that the RFmxVNA waits until the measurement is complete.
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 time, in seconds, to wait before results are available. Set this value to a time longer than expected for
fetching the measurement. A value of -1 specifies that the RFmxVNA waits until the measurement is complete.
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
)
error_code = self._interpreter.set_attribute_f64( # type: ignore
updated_selector_string, attributes.AttributeID.RESULT_FETCH_TIMEOUT.value, value
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def abort_measurements(self, selector_string):
r"""Stops acquisition and measurements associated with signal instance that you specify in the **Selector String**
parameter, which were previously initiated by the :py:meth:`initiate` or measurement read methods. Calling this method
is optional, unless you want to stop a measurement before it is complete. This method executes even if there is an
incoming error.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
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
)
error_code = self._interpreter.abort_measurements( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calibration_initiate(self, selector_string):
r"""Determines the set of calibration standard measurements required for performing calibration with the sweep and
calibration settings that you configure. Call this method after configuring all the appropriate sweep and calibration
settings such as Frequency Settings, Power Level and Test Receiver attenuation settings, IF Bandwidth, Calkit and Cal
Method related settings etc.
After you call this method, you can query number of distinct physical connection steps using
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_STEP_COUNT`. To understand the physical connection
required in a given cal step, query
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_STEP_DESCRIPTION` attribute. You can refer to
following sequence of operations to better understand the usage of this method in a typical calibration routine.
[START] -> ... -> [Select Measurement] -> [Configure Sweep Settings] -> [Configure Calibration Settings] ->
[Call RFmxVNA Auto Detect vCal Orientation VI] -> [Call RFmxVNA Calibration Initiate VI] -> [Query
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_STEP_COUNT`] -> [Query and make connection as per
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_STEP_DESCRIPTION` for Step<*m*>] -> [Call
:py:meth:`calibration_acquire` method for Step<*m*>] -> [Query and make connection as per
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_STEP_DESCRIPTION` for Step<*n*>] -> [Call
:py:meth:`calibration_acquire` method for Step<*n*>] -> [Call :py:meth:`calibration_save` VI] -> [Call
:py:meth:`calset_save_to_file` VI] -> ...-> [END].
.. note::
- You must select SParams or Wave measurement before calling this method.
- After calling this method, if you change any sweep and calibration setting, you must call this method again to commit the change(s) to said sweep and calibration setting(s).
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
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
)
error_code = self._interpreter.calibration_initiate( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calibration_acquire(self, selector_string, timeout):
r"""Measures one or more calibration standards for the specified calibration step.
You can call this method only after required calibration steps are determined by RFmx when you call
:py:meth:`calibration_initiate`. One successful call to :py:meth:`calibration_initiate` is sufficient for all
subsequent calls to this method.
When :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` is **Electronic**, RFmx
uses all relevant 1-port and 2-port calibration standards in the selected electronic calibration module. A single call
to this method measures all such cal standards in the electronic calibration module. For example, if you use NI
CAL-5501 electronic calkit to calibrate NI PXIe-5633 by using SOLT calibration method, you only need to perform 1
manual connection to connect the 2 cal module ports to 2 VNA ports. After setting up the required connection, a single
call to this method measures all relevant cal standards automatically.
When :py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_TYPE` is **Mechanical**, RFmx
can measure for only one cal standard for each cal step. Specify the active cal step in the Selector String. Use
:py:meth:`build_calstep_string` method to build cal step string. For example, if you calibrate the NI PXIe-5633 using a
mechanical calkit containing a Short, Open, Load and Thru discrete cal standards, then you must perform 7 distinct
manual connections, call this method once per cal step, which in-turn instructs you to connect an appropriate 1 or
2-port cal standard to the VNA port(s).
.. note::
You must call this method at least once for each cal step to measure corresponding calibration standard. If you call
this method more than once for a given cal step, the cal standard measurement data for the latest call overwrites the
previously measured data for the same standard. RFmx stores the cal standard measurement data which is later used to
compute error correction terms when you call :py:meth:`calibration_save` method.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
timeout (float):
This parameter specifies the timeout, in seconds, for acquiring the calibration data. Set this value to an appropriate
time, longer than expected for completing acqusition(s) for the speficied calibration step. A value of -1 specifies
that the method waits until the acquisition is complete. The default value is 10 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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calibration_acquire( # type: ignore
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calibration_abort(self, selector_string):
r"""Stops the calibration, which was previously initiated by :py:meth:`calibration_initiate`, for the signal instance that
you specify in the **Selector String** parameter. Calling this method is optional, unless you want to stop a
calibration before it is complete. This method executes even if there is an incoming error.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
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
)
error_code = self._interpreter.calibration_abort( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calibration_save(self, selector_string, calset_name):
r"""Computes error-correction terms and saves the calset in memory. Call this method after all calibration standards have
been measured using :py:meth:`calibration_acquire` method.
If you do not specify Calset Name input parameter, the calset is saved as default calset for the specified
signal and is not available for use in other signals. If you specify non-empty Calset Name string, calset is saved as a
named calset available for use across all signals and is also selected as the active calset for the current signal.
.. note::
To perform another calibration after you call this method, you must call :py:meth:`calibration_initiate` method again.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
calset_name (string):
This parameter specifies the name of the calset. If you do not specify this parameter, the calset is saved as default
calset for the specified signal and is not available for use in other signals. If you specify non-empty Calset Name
string, calset is saved as a named calset available for use across all signals and is also selected as the active
calset for the current signal.
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")
_helper.validate_not_none(calset_name, "calset_name")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calibration_save( # type: ignore
updated_selector_string, calset_name
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def clear_calset(self, selector_string, calset_name):
r"""Clears either the default calset of the specified signal or a named calset accessible across all signals.
Behaviors for different combinations of Calset Name and Signal Name strings are as follows:
- Calset Name is "" (empty string): RFmx clears the default calset of the signal instance specified in the Selector String. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is non-empty string: If you do not specify a Signal Name, then RFmx clears the named calset. RFmx returns an error if you specify both Calset Name and Signal Name as non-empty strings.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
calset_name (string):
This parameter specifies the name of the calset. If you do not specify this parameter, the calset is saved as default
calset for the specified signal and is not available for use in other signals. If you specify non-empty Calset Name
string, calset is saved as a named calset available for use across all signals and is also selected as the active
calset for the current signal.
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")
_helper.validate_not_none(calset_name, "calset_name")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.clear_calset( # type: ignore
updated_selector_string, calset_name
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calset_load_from_file(self, selector_string, calset_name, calset_file_path):
r"""Loads calset from a calset file (*.ncst), either to the default calset of the specified signal or to a named calset
accessible across all signals.
Behaviors for different combinations of Calset Name and Signal Name strings are as follows:
- Calset Name is "" (empty string): RFmx loads calset from file to the default calset of the signal instance specified in the Selector String and selects the default calset as active calset for the signal. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is non-empty string: If you do not specify a Signal Name, then RFmx loads calset from file to a named calset. RFmx returns an error if you specify both Calset Name and Signal Name as non-empty strings.
.. note::
This method will overwrite the contents of the calset if it already exists.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
calset_name (string):
This parameter specifies the name of the calset. If you do not specify this parameter, the calset is saved as default
calset for the specified signal and is not available for use in other signals. If you specify non-empty Calset Name
string, calset is saved as a named calset available for use across all signals and is also selected as the active
calset for the current signal.
calset_file_path (string):
This parameter specifies the complete path to the file with .ncst extension from which the calset is to be loaded.
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")
_helper.validate_not_none(calset_name, "calset_name")
_helper.validate_not_none(calset_file_path, "calset_file_path")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calset_load_from_file( # type: ignore
updated_selector_string, calset_name, calset_file_path
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calset_save_to_file(self, selector_string, calset_name, calset_file_path):
r"""Saves to a calset file (*.ncst), either the default calset of the specified signal or a named calset accessible across
all signals and corresponding relevant stimulus settings that were used to perform calibration.
Behaviors for different combinations of Calset Name and Signal Name strings are as follows:
- Calset Name is "" (empty string): RFmx saves to file, the default calset of the signal instance specified in the Selector String. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is non-empty string: If you do not specify a Signal Name, then RFmx saves the named calset to file. RFmx returns an error if you specify both Calset Name and Signal Name as non-empty strings.
Apart from error correction terms, important stimulus settings used to perform calibration are also saved as
part of the calset. When you select an active calset for a signal using :py:meth:`select_active_calset` method, specify
whether you want to change the signal settings to match the stimulus settings of the selected calset, using the
**Restore Configuration** input parameter set to ‘Stimulus’. The following stimulus settings are saved as part of the
calset:
- SweepType
- **List** Sweep Type: IF Bandwidth, Power Level per Port, Test Receiver Attenuation per Port, Frequency List
- **Linear** Sweep Type: IF Bandwidth, Power Level per Port, Test Receiver Attenuation per Port, Start Frequency, Stop Frequency and Number of Frequency Points
- **Segment** Sweep Type: Segment IF Bandwidth, Segment Power Level per Port, Segment Test Receiver Attenuation per Port, Segment Start Frequency, Segment Stop Frequency and Segment Number of Frequency Points
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
calset_name (string):
This parameter specifies the name of the calset. If you do not specify this parameter, the calset is saved as default
calset for the specified signal and is not available for use in other signals. If you specify non-empty Calset Name
string, calset is saved as a named calset available for use across all signals and is also selected as the active
calset for the current signal.
calset_file_path (string):
This parameter specifies the absolute path to the calset file (*.ncst). If the path you specified does not end with
'.ncst' file extension, then RFmx automatically adds the extension before saving the file to disk. If the path you
specify points to an already existing calset file, then RFmx overwrites that file without warning.
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")
_helper.validate_not_none(calset_name, "calset_name")
_helper.validate_not_none(calset_file_path, "calset_file_path")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calset_save_to_file( # type: ignore
updated_selector_string, calset_name, calset_file_path
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def auto_detect_vcal_orientation(self, selector_string):
r"""Automatically detects the vCal ports connected to the VNA ports and writes the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_ELECTRONIC_ORIENTATION` attribute. Call this
method before calling :py:meth:`calibration_initiate`.
Auto detection of vCal orientation initially occurs at the midpoint of the frequency range specified for the
calibration. If the connection is not detected, it retries at the lowest frequnecy in the configured range.
The auto detection may fail if the power level at the vCal module is too low. If it fails, use the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_CALIBRATION_CALKIT_ELECTRONIC_ORIENTATION` attribute to
configure the orientation manually
.. note::
You must select SParams or Wave measurement before calling this method.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
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
)
error_code = self._interpreter.auto_detect_vcal_orientation( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def check_measurement_status(self, selector_string):
r"""Checks the status of the measurement. Use this method to check for any errors that may occur during measurement or to
check whether the measurement is complete and results are available.
Args:
selector_string (string):
This parameter specifies a selector string comprising of result name.
Example:
""
"result::r1"
You can use the :py:meth:`build_s_parameter_string` method to build the selector string.
Returns:
Tuple (is_done, error_code):
is_done (bool):
This parameter indicates whether the measurement is complete.
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
)
is_done, error_code = self._interpreter.check_measurement_status( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return is_done, error_code
@_raise_if_disposed
def clear_all_named_results(self, selector_string):
r"""Clears all results for the signal that you specify in the Selector String parameter.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
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
)
error_code = self._interpreter.clear_all_named_results( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def clear_named_result(self, selector_string):
r"""Clears a result instance specified by the result name in the Selector String parameter.
Args:
selector_string (string):
This parameter specifies a selector string comprising of result name.
Example:
""
"result::r1"
You can use the :py:meth:`build_s_parameter_string` method to build the selector string.
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
)
error_code = self._interpreter.clear_named_result( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def copy_calset(self, selector_string, source_calset_name, new_calset_name):
r"""Copies into a new calset either from the default calset of the specified signal or a named calset accessible across all
signals.
Behaviors for different combinations of Source Calset Name and Signal Name strings are as follows:
- Source Calset Name is "" (empty string): RFmx copies the default calset of the signal instance specified in the Selector String into the New Calset you specify. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is non-empty string: If you do not specify a Signal Name, then RFmx copies the named calset into the New Calset you specify. RFmx returns an error if you specify both Calset Name and Signal Name as non-empty strings.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
source_calset_name (string):
This parameter specifies the name of the source calset from which calset data will be copied.
new_calset_name (string):
This parameter specifies the name of the new calset to which calset data will be copied. You must specify this
parameter to a non-empty string.
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")
_helper.validate_not_none(source_calset_name, "source_calset_name")
_helper.validate_not_none(new_calset_name, "new_calset_name")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.copy_calset( # type: ignore
updated_selector_string, source_calset_name, new_calset_name
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def select_active_calset(self, selector_string, calset_name, restore_configuration):
r"""Selects either the default calset of the specified signal or a named calset accessible across all signals as active
calset for the specified signal.
Behaviors for different combinations of Calset Name and Signal Name strings specified are as follows:
- Calset Name is "" (empty string): RFmx selects the default calset as the active calset for the signal instance specified in the Selector String. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is non-empty string: RFmx selects the named calset as the active calset for the signal instance specified in the Selector String. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
You can use :py:meth:`get_all_calset_names` method to get the list of available named calsets.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
calset_name (string):
This parameter specifies the name of the calset. If you do not specify this parameter, the calset is saved as default
calset for the specified signal and is not available for use in other signals. If you specify non-empty Calset Name
string, calset is saved as a named calset available for use across all signals and is also selected as the active
calset for the current signal.
restore_configuration (enums.RestoreConfiguration, int):
This parameter specifies whether the stimulus settings from the specified calset should be applied to the signal.
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+==============+==========================================================================================================================+
| None (0) | Do not apply the stimulus settings from the calset. |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
| Stimulus (1) | Applies the stimulus settings from the calset. |
| | List of stimulus settings that will be applied are as follows: |
| | SweepType |
| | List Sweep Type: IF Bandwidth, Power Level per Port, Test Receiver Attenuation per Port, Frequency List |
| | Linear Sweep Type: IF Bandwidth, Power Level per Port, Test Receiver Attenuation per Port, Start Frequency, Stop |
| | Frequency and Number of Points |
| | Segment Sweep Type: Segment IF Bandwidth, Segment Power Level per Port, Segment Test Receiver Attenuation per Port, |
| | Segment Start Frequency, Segment Stop Frequency and Segment Number of Frequency Points |
| | CW Time Sweep Type: IF Bandwidth, Power Level per Port, Test Receiver Attenuation per Port, CW Frequency and Number of |
| | Points |
+--------------+--------------------------------------------------------------------------------------------------------------------------+
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")
_helper.validate_not_none(calset_name, "calset_name")
restore_configuration = (
restore_configuration.value
if type(restore_configuration) is enums.RestoreConfiguration
else restore_configuration
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.select_active_calset( # type: ignore
updated_selector_string, calset_name, restore_configuration
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_all_calset_names(self, selector_string):
r"""Returns an array of calset names of all the available named calsets which are accessible across all signals.
Args:
selector_string (string):
This parameter is ignored currently by this VI
Returns:
Tuple (calset_names, error_code):
calset_names (string):
This parameter returns an array of calset names for all the available named calsets.
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
)
calset_names, error_code = self._interpreter.get_all_calset_names( # type: ignore
updated_selector_string
)
calset_names = _helper.split_string_by_comma(calset_names)
finally:
self._session_function_lock.exit_read_lock()
return calset_names, error_code
@_raise_if_disposed
def commit(self, selector_string):
r"""Commits settings to the hardware. Calling this method is optional. RFmxVNA commits settings to the hardware when you
call the :py:meth:`initiate` method.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
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
)
error_code = self._interpreter.commit(updated_selector_string) # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def initiate(self, selector_string, result_name):
r"""Initiates all enabled measurements. Call this method after configuring the signal and measurement. This method
asynchronously launches measurements in the background and immediately returns to the caller program. You can fetch
measurement results using the Fetch methods or result attributes in the attribute node. To get the status of
measurements, use the :py:meth:`wait_for_measurement_complete` method or :py:meth:`check_measurement_status` method.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
result_name (string):
This parameter specifies the name to be associated with measurement results. Provide a unique name, such as "r1" to
enable fetching of multiple measurement results and traces. This input accepts the result name with or without the
"result::" prefix. The default value is "" (empty string), which refers to the default result instance.
Example:
""
"result::r1"
"r1"
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")
_helper.validate_not_none(result_name, "result_name")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.initiate( # type: ignore
updated_selector_string, result_name
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def reset_to_default(self, selector_string):
r"""Resets a signal to the default values.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
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
)
error_code = self._interpreter.reset_to_default(updated_selector_string) # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def select_measurements(self, selector_string, measurements, enable_all_traces):
r"""Enables all the measurements that you specify in the Measurements parameter and disables all other measurements.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
measurements (enums.MeasurementTypes, int):
This parameter specifies the measurement(s) to perform. You can specify one or more of the following measurements. The
default is an empty array.
+--------------+----------------------------------+
| Name (Value) | Description |
+==============+==================================+
| SParams (0) | Enables S-Parameter measurement. |
+--------------+----------------------------------+
| Waves (1) | Enables Wave measurement. |
+--------------+----------------------------------+
enable_all_traces (bool):
This parameter specifies whether to enable all traces for the selected measurement. The default value is **FALSE**.
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")
measurements = (
measurements.value if type(measurements) is enums.MeasurementTypes else measurements
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.select_measurements( # type: ignore
updated_selector_string, measurements, int(enable_all_traces)
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def wait_for_measurement_complete(self, selector_string, timeout):
r"""Waits for the specified number for seconds for all the measurements to complete.
Args:
selector_string (string):
This parameter specifies a selector string comprising of result name.
Example:
""
"result::r1"
You can use the :py:meth:`build_s_parameter_string` method to build the selector string.
timeout (float):
This parameter specifies the timeout, in seconds, for fetching the specified measurement. 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:
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
)
error_code = self._interpreter.wait_for_measurement_complete( # type: ignore
updated_selector_string, timeout
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calset_embed_fixture_s2p(
self,
selector_string,
calset_name,
fixture_s2p_file_path,
vna_port,
s_parameter_orientation,
new_calset_name,
):
r"""Embeds the inverse of a given fixture network into a specified calset.
The typical use case for this utility is to remove the effect of an adapter that was present during calibration
but is not present during later measurements from the Calset itself such that corrected measurements can be performed
without considering the calibration adapter in the measurement de-embedding.
Behaviors for different combinations of New Calset Name, Calset Name and Signal Name strings are as follows:
- Both Calset Name and New Calset Name are "" (empty string): RFmx modifies the default calset of the signal instance specified in the Selector String, with embedding data. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is "" (empty string) and New Calset Name is non-empty string: RFmx creates a new named calset with the name specified by New Calset Name from the default calset of the signal instance specified in the Selector String and modifies the new named calset with embedding data. This newly created named calset is made accessible across all signals. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is non-empty string and New Calset Name is "" (empty string): If you do not specify a Signal Name, then RFmx modifies the existing named calset with embedding data. RFmx returns an error if you specify both Calset Name and Signal Name as non-empty strings.
- Both Calset Name and New Calset Name are non-empty string: If you do not specify a Signal Name, then RFmx creates a new named calset with the name specified by New Calset Name from the existing named calset specified by Calset Name and modifies the new named calset with embedding data. RFmx returns an error if you specify both Calset Name and Signal Name as non-empty strings.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
calset_name (string):
This parameter specifies the name of the calset. If you do not specify this parameter, the calset is saved as default
calset for the specified signal and is not available for use in other signals. If you specify non-empty Calset Name
string, calset is saved as a named calset available for use across all signals and is also selected as the active
calset for the current signal.
fixture_s2p_file_path (string):
This parameter Specifies the path to the s2p file containing the fixture S-parameters.
vna_port (string):
This parameter specifies the port name of the Calset VNA port.
s_parameter_orientation (enums.SParameterOrientation, int):
This parameter specifies the orientation of the configured fixture network with respect to VNA port.
+-----------------------+----------------------------------------------------------+
| Name (Value) | Description |
+=======================+==========================================================+
| Port1 Towards VNA (0) | Specifies that port1 of the fixture is towards VNA port. |
+-----------------------+----------------------------------------------------------+
| Port2 Towards VNA (1) | Specifies that port2 of the fixture is towards VNA port. |
+-----------------------+----------------------------------------------------------+
new_calset_name (string):
This parameter specifies the name under which the result Calset (with updated error coefficients) is to be saved. If
empty string is provided, the updated Calset is saved back into the original Calset. That is, the original Calset is
overwritten.
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")
_helper.validate_not_none(calset_name, "calset_name")
_helper.validate_not_none(fixture_s2p_file_path, "fixture_s2p_file_path")
_helper.validate_not_none(vna_port, "vna_port")
s_parameter_orientation = (
s_parameter_orientation.value
if type(s_parameter_orientation) is enums.SParameterOrientation
else s_parameter_orientation
)
_helper.validate_not_none(new_calset_name, "new_calset_name")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calset_embed_fixture_s2p( # type: ignore
updated_selector_string,
calset_name,
fixture_s2p_file_path,
vna_port,
s_parameter_orientation,
new_calset_name,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def deselect_active_calset(self, selector_string):
r"""Deselects the active calset of the specified signal. You can select an active calset again using
:py:meth:`select_active_calset` method.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
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
)
error_code = self._interpreter.deselect_active_calset( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def load_data_to_measurement_memory_from_file(
self, selector_string, file_path, parameter, measurement_memory_name
):
r"""Loads the data from the input file to the measurement memory specified by the Selector String.
.. note::
This method will overwrite the contents of the measurement memory if it already exists.
Args:
selector_string (string):
This parameter specifies a selector string comprising of the measurement number. You must specify the measurement number.
Example:
"sparam0"
You can use the :py:meth:`build_s_parameter_string` method to build the selector string.
file_path (string):
This parameter specifies the path to the file that contains the measurement data.
Example:
For S-Parameter measurement use a *.SnP file.
parameter (string):
This parameter specifies the measurement parameter to load from the file.
Example:
Specify S11 for an *.S1P file.
Specify 'S11 or S12 or S21 or S22 for an *.S2P file.
measurement_memory_name (string):
This parameter Measurement Memory Name specifies the name to associate with the data you load to the measurement
memory. Provide a unique name.
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")
_helper.validate_not_none(file_path, "file_path")
_helper.validate_not_none(parameter, "parameter")
_helper.validate_not_none(measurement_memory_name, "measurement_memory_name")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.load_data_to_measurement_memory_from_file( # type: ignore
updated_selector_string, file_path, parameter, measurement_memory_name
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def copy_data_to_measurement_memory(self, selector_string, measurement_memory_name):
r"""Copies data into specified measurement memory from measurement result specified by the selector string.
.. note::
This method will overwrite the contents of the measurement memory if it already exists.
Args:
selector_string (string):
This parameter specifies a selector string comprising of the measurement number. You must specify the measurement number.
Example:
"sparam0"
You can use the :py:meth:`build_s_parameter_string` method to build the selector string.
measurement_memory_name (string):
This parameter Measurement Memory Name specifies the name to associate with the data you load to the measurement
memory. Provide a unique name.
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")
_helper.validate_not_none(measurement_memory_name, "measurement_memory_name")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.copy_data_to_measurement_memory( # type: ignore
updated_selector_string, measurement_memory_name
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_measurement_memory_names(self, selector_string):
r"""Returns an array of measurement memory names for the given signal and the measurement number.
Args:
selector_string (string):
This parameter specifies a selector string comprising of measurement number.
Example:
"sparam0"
You can use the :py:meth:`build_s_parameter_string` method to build the selector string.
Returns:
Tuple (measurement_memory_names, error_code):
measurement_memory_names (string):
This parameter returns an array of Measurement Memory Names for the given measurement number.
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
)
measurement_memory_names, error_code = self._interpreter.get_measurement_memory_names( # type: ignore
updated_selector_string
)
measurement_memory_names = _helper.split_string_by_comma(measurement_memory_names)
finally:
self._session_function_lock.exit_read_lock()
return measurement_memory_names, error_code
@_raise_if_disposed
def clear_measurement_memory_names(self, selector_string):
r"""Clears the measurement memory for the measurement number specified by the Selector String.
.. note::
- If Measurement memory name is "" (empty string): RFmx clears all the measurement memories associated with the measurement number.
- If measurement memory name is non-empty string: RFmx clears the specified measurement memory.
Args:
selector_string (string):
This parameter specifies a selector string comprising of measurement number and the measurement memory
name. You must specify the measurement
number.
Example:
"sparam0"
You can use the :py:meth:`build_measurement_memory_string` along with:py:meth:`build_s_parameter_string` method
to build the selector string.
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
)
error_code = self._interpreter.clear_measurement_memory_names( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def auto_port_extension_measure(self, selector_string, standard, port):
r"""Automatically determine the fixture delay and loss (optional) values by measuring the standard at the configured port.
The calculated delay and loss values are used to set the
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DELAY`,
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_DC_LOSS`,
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS1` and
:py:attr:`~nirfmxvna.attributes.AttributeID.CORRECTION_PORT_EXTENSION_LOSS2` attributes. Call this method after
calibrating the VNA port, where port extension is required, to obtain more accurate delay and loss estimates.
An ideal OPEN and SHORT standard, with zero loss and delay, is assumed. Therefore, the accuracy depends on the
quality of the standard.
To measure either OPEN or SHORT, call auto port extension reset before measuring the standard.
When both OPEN and SHORT standards are measured, the average of the calculated delay and loss values are
entered.
.. note::
You must call :py:meth:`initiate` afterwards to obtain the compensated measurement results.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
standard (enums.CorrectionPortExtensionAutoStandard, int):
This parameter specifies the standard to be measured.
+--------------+-----------------------------+
| Name (Value) | Description |
+==============+=============================+
| Open (0) | Open standard is measured. |
+--------------+-----------------------------+
| Short (1) | Short standard is measured. |
+--------------+-----------------------------+
port (string):
This parameter specifies the calibrated port at which the Open or Short standard is connected.
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")
standard = (
standard.value
if type(standard) is enums.CorrectionPortExtensionAutoStandard
else standard
)
_helper.validate_not_none(port, "port")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.auto_port_extension_measure( # type: ignore
updated_selector_string, standard, port
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_import_calkit(self, selector_string, calkit_file_path):
r"""Imports a Calkit file into the Calkit Manager.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calkit_file_path (string):
This parameter specifies the absoulte path to the calkit file (.nckt).
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")
_helper.validate_not_none(calkit_file_path, "calkit_file_path")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_import_calkit( # type: ignore
updated_selector_string, calkit_file_path
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_export_calkit(self, selector_string, calkit_id, calkit_file_path):
r"""Exports a Calkit to file.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calkit_id (string):
This parameter specifies the ID for the Calkit in Calkit Manager.
calkit_file_path (string):
This parameter specifies the absoulte path to the calkit file (.nckt).
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")
_helper.validate_not_none(calkit_id, "calkit_id")
_helper.validate_not_none(calkit_file_path, "calkit_file_path")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_export_calkit( # type: ignore
updated_selector_string, calkit_id, calkit_file_path
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_create_calkit(self, selector_string, calkit_id):
r"""Creates a new empty Calkit with the user defined Calkit ID in Calkit Manager. The user defined Calkit ID has to be
unique among all Calkits in Calkit Manager.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calkit_id (string):
This parameter specifies the ID for the Calkit in Calkit Manager.
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")
_helper.validate_not_none(calkit_id, "calkit_id")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_create_calkit( # type: ignore
updated_selector_string, calkit_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_remove_calkit(self, selector_string, calkit_id):
r"""Removes a Calkit from Calkit Manager.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calkit_id (string):
This parameter specifies the ID for the Calkit in Calkit Manager.
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")
_helper.validate_not_none(calkit_id, "calkit_id")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_remove_calkit( # type: ignore
updated_selector_string, calkit_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_validate_calkit(self, selector_string, calkit_id):
r"""Validates the consistency of a Calkit definition and returns the status of the validation.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calkit_id (string):
This parameter specifies the ID for the Calkit in Calkit Manager.
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")
_helper.validate_not_none(calkit_id, "calkit_id")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_validate_calkit( # type: ignore
updated_selector_string, calkit_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_get_calkit_ids(self, selector_string):
r"""Returns a list of Calkit IDs for all Calkits currently loaded in Calkit Manager.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (calkit_ids, error_code):
calkit_ids (string):
This parameter returns the list of Calkit IDs for all Calkit files currently loaded in Calkit Manager.
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
)
calkit_ids, error_code = self._interpreter.calkit_manager_get_calkit_ids( # type: ignore
updated_selector_string
)
calkit_ids = _helper.split_string_by_comma(calkit_ids)
finally:
self._session_function_lock.exit_read_lock()
return calkit_ids, error_code
@_raise_if_disposed
def calkit_manager_calkit_add_connector(self, selector_string, connector_id):
r"""Adds a new Connector with a user defined Connector ID to the Calkit. The user defined Connector ID has to be unique
among all Connectors in the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
connector_id (string):
This parameter specifies the ID of the Connector within the Calkit.
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")
_helper.validate_not_none(connector_id, "connector_id")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_add_connector( # type: ignore
updated_selector_string, connector_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_remove_connector(self, selector_string, connector_id):
r"""Removes a Connector element from the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
connector_id (string):
This parameter specifies the ID of the Connector within the Calkit.
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")
_helper.validate_not_none(connector_id, "connector_id")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_remove_connector( # type: ignore
updated_selector_string, connector_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_get_connector_ids(self, selector_string):
r"""Returns the list of Connector IDs for all connectors in the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (connector_ids, error_code):
connector_ids (string):
This parameter returns the list of Connector IDs for all connectors in the Calkit.
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
)
connector_ids, error_code = self._interpreter.calkit_manager_calkit_get_connector_ids( # type: ignore
updated_selector_string
)
connector_ids = _helper.split_string_by_comma(connector_ids)
finally:
self._session_function_lock.exit_read_lock()
return connector_ids, error_code
@_raise_if_disposed
def calkit_manager_calkit_add_calibration_element(
self, selector_string, calibration_element_id
):
r"""Adds a new Calibration Element with a user defined Calibration Element ID to the Calkit. The user defined Calibration
Element ID has to be unique among all Calibration Elements in the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calibration_element_id (string):
This parameter specifies the ID of the Calibration Element within the Calkit.
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")
_helper.validate_not_none(calibration_element_id, "calibration_element_id")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_add_calibration_element( # type: ignore
updated_selector_string, calibration_element_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_remove_calibration_element(
self, selector_string, calibration_element_id
):
r"""Removes the Calibration Element identified by its Calibration Element ID from the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calibration_element_id (string):
This parameter specifies the ID of the Calibration Element within the Calkit.
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")
_helper.validate_not_none(calibration_element_id, "calibration_element_id")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_remove_calibration_element( # type: ignore
updated_selector_string, calibration_element_id
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_get_calibration_element_ids(self, selector_string):
r"""Returns a list of Calibration Element IDs of all Calibration Elements of the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (calibration_element_ids, error_code):
calibration_element_ids (string):
This parameter returns the list of Calibration Element IDs of all Calibration Elements of the Calkit.
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
)
calibration_element_ids, error_code = self._interpreter.calkit_manager_calkit_get_calibration_element_ids( # type: ignore
updated_selector_string
)
calibration_element_ids = _helper.split_string_by_comma(calibration_element_ids)
finally:
self._session_function_lock.exit_read_lock()
return calibration_element_ids, error_code
@_raise_if_disposed
def calkit_manager_calkit_set_description(self, selector_string, calkit_description):
r"""Sets the description for the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calkit_description (string):
This parameter specifies the description of the Calkit.
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")
_helper.validate_not_none(calkit_description, "calkit_description")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_set_description( # type: ignore
updated_selector_string, calkit_description
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_set_version(self, selector_string, calkit_version):
r"""Sets the version string for the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calkit_version (string):
This parameter specifies the version string of the Calkit.
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")
_helper.validate_not_none(calkit_version, "calkit_version")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_set_version( # type: ignore
updated_selector_string, calkit_version
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_set_trl_reference_plane(self, selector_string, reference_plane):
r"""Sets the calibration standard (Thru or Reflect) that is used to define the measurement reference plane for TRL
calibration. Use Reflect, if the Thru standard is uncertainly known and the Reflect standard is well defined. Otherwise
use the Thru standard to define the reference plane.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
reference_plane (enums.CalkitManagerCalkitTrlReferencePlane, int):
This parameter specifies the TRL calibration standard (Thru or Reflect) used to define the reference plane.
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")
reference_plane = (
reference_plane.value
if type(reference_plane) is enums.CalkitManagerCalkitTrlReferencePlane
else reference_plane
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_set_trl_reference_plane( # type: ignore
updated_selector_string, reference_plane
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_set_lrl_line_auto_char(
self, selector_string, auto_characterization_enabled
):
r"""Configures whether line parameters are automatically characterized during LRL calibration. LRL line auto
characterization is applicable only when the Line standards have the same characteristic impedance.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
auto_characterization_enabled (bool):
This parameter specifies whether line parameters are automatically characterized during LRL calibration.
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
)
error_code = self._interpreter.calkit_manager_calkit_set_lrl_line_auto_char( # type: ignore
updated_selector_string, int(auto_characterization_enabled)
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_set_description(self, selector_string, description):
r"""Sets the description for a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
description (string):
This parameter specifies the description for a Connector of a specific Calkit.
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")
_helper.validate_not_none(description, "description")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_connector_set_description( # type: ignore
updated_selector_string, description
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_set_gender(self, selector_string, connector_gender):
r"""Sets the Gender of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
connector_gender (enums.CalkitManagerCalkitConnectorGender, int):
This parameter specifies the Gender of a Connector of a specific Calkit.
+--------------+-------------+
| Name (Value) | Description |
+==============+=============+
| Male (0) | |
+--------------+-------------+
| Female (1) | |
+--------------+-------------+
| NoGender (2) | |
+--------------+-------------+
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")
connector_gender = (
connector_gender.value
if type(connector_gender) is enums.CalkitManagerCalkitConnectorGender
else connector_gender
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_connector_set_gender( # type: ignore
updated_selector_string, connector_gender
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_set_type(self, selector_string, connector_type):
r"""Sets the Type of a Connector of a specific Calkit. Connector type is a user defined string (for example 'SMA', '1.8mm',
etc.).
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
connector_type (string):
This parameter specifies the Type of a Connector of a specific Calkit.
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")
_helper.validate_not_none(connector_type, "connector_type")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_connector_set_type( # type: ignore
updated_selector_string, connector_type
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_set_impedance(self, selector_string, impedance):
r"""Sets the Impedance of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
impedance (float):
This parameter specifies the Impedance of a Connector of a specific Calkit.
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
)
error_code = self._interpreter.calkit_manager_calkit_connector_set_impedance( # type: ignore
updated_selector_string, impedance
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_set_minimum_frequency(
self, selector_string, minimum_frequency
):
r"""Sets the Minimum Frequency of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
minimum_frequency (float):
This parameter specifies the Minimum Frequency of a Connector of a specific Calkit.
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
)
error_code = self._interpreter.calkit_manager_calkit_connector_set_minimum_frequency( # type: ignore
updated_selector_string, minimum_frequency
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_set_maximum_frequency(
self, selector_string, maximum_frequency
):
r"""Sets the Maximum Frequency of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
maximum_frequency (float):
This parameter specifies the Maximum Frequency of a Connector of a specific Calkit.
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
)
error_code = self._interpreter.calkit_manager_calkit_connector_set_maximum_frequency( # type: ignore
updated_selector_string, maximum_frequency
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_set_description(
self, selector_string, description
):
r"""Sets the description for a Calibration Element of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
description (string):
This parameter specifies the description for a Calibration Element of a specific Calkit.
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")
_helper.validate_not_none(description, "description")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_set_description( # type: ignore
updated_selector_string, description
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_set_types(
self, selector_string, calibration_element_types
):
r"""Sets the type(s) of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
calibration_element_types (enums.CalkitManagerCalkitCalibrationElementType, int):
This parameter specifies the type(s) of the Calibration Element.
+-----------------+------------------------------------------------------------------------+
| Name (Value) | Description |
+=================+========================================================================+
| Unknown (0) | Unknown calibration element. |
+-----------------+------------------------------------------------------------------------+
| Load (1) | Valid for SOL(T/R) calibration types. |
+-----------------+------------------------------------------------------------------------+
| Open (2) | Valid for SOL(T/R) calibration types. |
+-----------------+------------------------------------------------------------------------+
| Short (3) | Valid for SOL(T/R) calibration types. |
+-----------------+------------------------------------------------------------------------+
| Line (4) | Valid for TRL/LRL calibration types. |
+-----------------+------------------------------------------------------------------------+
| Reflect (5) | Valid for TRL/LRL calibration types. |
+-----------------+------------------------------------------------------------------------+
| Termination (6) | Use instead of Short/Open/Load, if multiple such elements are present. |
+-----------------+------------------------------------------------------------------------+
| Thru (7) | Valid for SOL(T/R) calibration types. |
+-----------------+------------------------------------------------------------------------+
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")
calibration_element_types = (
[v.value for v in calibration_element_types]
if (
isinstance(calibration_element_types, list)
and all(
isinstance(v, enums.CalkitManagerCalkitCalibrationElementType)
for v in calibration_element_types
)
)
else calibration_element_types
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_set_types( # type: ignore
updated_selector_string, calibration_element_types
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_get_port_connectors(self, selector_string):
r"""Returns the array of Connectors associated with the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (connector_ids, error_code):
connector_ids (string):
This parameter returns the array of Connectors associated with the Calibration Element.
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
)
connector_ids, error_code = self._interpreter.calkit_manager_calkit_calibration_element_get_port_connectors( # type: ignore
updated_selector_string
)
connector_ids = _helper.split_string_by_comma(connector_ids)
finally:
self._session_function_lock.exit_read_lock()
return connector_ids, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_set_s_parameter_definition(
self, selector_string, s_parameter_definition
):
r"""Defines the way how the S-Parameters of the Calibration Element are specified.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s_parameter_definition (enums.CalkitManagerCalkitCalibrationElementSParameterDefinition, int):
This parameter specifies the S-Parameter definition of the Calibration Element.
+-------------------+-----------------------------------------------------------------+
| Name (Value) | Description |
+===================+=================================================================+
| Reflect Model (0) | S-Parameters defined by the Reflect model (1-port). |
+-------------------+-----------------------------------------------------------------+
| Sparameter (1) | S-Parameters defined by a S-Parameter list (1-port and 2-port). |
+-------------------+-----------------------------------------------------------------+
| Delay Model (2) | S-Parameters defined by a delay model (2-port). |
+-------------------+-----------------------------------------------------------------+
| Unknown (3) | S-Parameters not further specified. |
+-------------------+-----------------------------------------------------------------+
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")
s_parameter_definition = (
s_parameter_definition.value
if type(s_parameter_definition)
is enums.CalkitManagerCalkitCalibrationElementSParameterDefinition
else s_parameter_definition
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_set_s_parameter_definition( # type: ignore
updated_selector_string, s_parameter_definition
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_set_minimum_frequency(
self, selector_string, minimum_frequency
):
r"""Sets the Minimum Frequency of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
minimum_frequency (float):
This parameter specifies the Minimum Frequency of the Calibration Element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_set_minimum_frequency( # type: ignore
updated_selector_string, minimum_frequency
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_set_maximum_frequency(
self, selector_string, maximum_frequency
):
r"""Sets the Maximum Frequency of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
maximum_frequency (float):
This parameter specifies the Maximum Frequency of the Calibration Element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_set_maximum_frequency( # type: ignore
updated_selector_string, maximum_frequency
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_model_type(
self, selector_string, model_type
):
r"""Specifies the model type of the 1-port reflect standard.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
model_type (enums.CalkitManagerCalkitCalibrationElementReflectModelType, int):
This parameter specifies the model type of of the 1-port reflect standard.
+-------------------+--------------------------------------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===================+==========================================================================================================================+
| Reflect Open (0) | Models an Offset Open by specifying the offset parameters and the parameters of the Open (3rd order polynomial model of |
| | the capacitance). |
+-------------------+--------------------------------------------------------------------------------------------------------------------------+
| Reflect Short (1) | Models an Offset Short by specifying the offset parameters and the parameters of the short (3rd order polynomial model |
| | of the inductance). |
+-------------------+--------------------------------------------------------------------------------------------------------------------------+
| Load (2) | Models an Offset Load by specifying the offset parameters. |
+-------------------+--------------------------------------------------------------------------------------------------------------------------+
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")
model_type = (
model_type.value
if type(model_type) is enums.CalkitManagerCalkitCalibrationElementReflectModelType
else model_type
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_model_type( # type: ignore
updated_selector_string, model_type
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_s_param_availability(
self, selector_string, s_parameter_availability
):
r"""Specifies the S-Parameter availability.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s_parameter_availability (enums.CalkitManagerCalkitCalibrationElementReflectModelSParameterAvailability, int):
This parameter specifies the S-Parameter availability.
+--------------+----------------------------------------+
| Name (Value) | Description |
+==============+========================================+
| Estimate (0) | S-Parameters treated as roughly known. |
+--------------+----------------------------------------+
| Known (1) | S-Parameters treated as exactly known. |
+--------------+----------------------------------------+
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")
s_parameter_availability = (
s_parameter_availability.value
if type(s_parameter_availability)
is enums.CalkitManagerCalkitCalibrationElementReflectModelSParameterAvailability
else s_parameter_availability
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_s_param_availability( # type: ignore
updated_selector_string, s_parameter_availability
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_c0(self, selector_string, c0):
r"""Specifies the 0th order coefficient of the 3rd order polynomial capacitance/inductance model for the Reflect
Open/Reflect Short model type.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
c0 (float):
This parameter specifies the 0th order coefficient of the 3rd order polynomial capacitance/inductance model for the
Reflect Open/Reflect Short model type.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_c0( # type: ignore
updated_selector_string, c0
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_c1(self, selector_string, c1):
r"""Specifies the 1st order coefficient of the 3rd order polynomial capacitance/inductance model for the Reflect
Open/Reflect Short model type.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
c1 (float):
This parameter specifies the 1st order coefficient of the 3rd order polynomial capacitance/inductance model for the
Reflect Open/Reflect Short model type.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_c1( # type: ignore
updated_selector_string, c1
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_c2(self, selector_string, c2):
r"""Specifies the 2nd order coefficient of the 3rd order polynomial capacitance/inductance model for the Reflect
Open/Reflect Short model type.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
c2 (float):
This parameter specifies the 2nd order coefficient of the 3rd order polynomial capacitance/inductance model for the
Reflect Open/Reflect Short model type.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_c2( # type: ignore
updated_selector_string, c2
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_c3(self, selector_string, c3):
r"""Specifies the 3rd order coefficient of the 3rd order polynomial capacitance/inductance model for the Reflect
Open/Reflect Short model type.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
c3 (float):
This parameter specifies the 3rd order coefficient of the 3rd order polynomial capacitance/inductance model for the
Reflect Open/Reflect Short model type.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_c3( # type: ignore
updated_selector_string, c3
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_offset_delay(
self, selector_string, offset_delay
):
r"""Specifies the offset delay.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
offset_delay (float):
This parameter specifies the offset delay.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_offset_delay( # type: ignore
updated_selector_string, offset_delay
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_offset_loss(
self, selector_string, offset_loss
):
r"""Specifies the offset loss.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
offset_loss (float):
This parameter specifes the offset loss.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_offset_loss( # type: ignore
updated_selector_string, offset_loss
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_offset_z0(
self, selector_string, offset_z0
):
r"""Specifies the impedance of the offset.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
offset_z0 (float):
This parameter specifies the impedance of the 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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_offset_z0( # type: ignore
updated_selector_string, offset_z0
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_set_reference_impedance(
self, selector_string, reference_impedance
):
r"""Specifies the reference impedance.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
reference_impedance (float):
This parameter specifies the reference impedance.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_set_reference_impedance( # type: ignore
updated_selector_string, reference_impedance
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_delay_model_set_delay(
self, selector_string, delay
):
r"""Defines the Delay of a Calibration Element defined by the Delay Model.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
delay (float):
This parameter specifies the Delay of a Calibration Element defined by the Delay Model.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_delay_model_set_delay( # type: ignore
updated_selector_string, delay
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_set_frequency(
self, selector_string, frequency
):
r"""Defines the frequency array for the S-Parameter definition of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
frequency (float):
This parameter specifies the frequency array for the S-Parameter definition of the Calibration Element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_set_frequency( # type: ignore
updated_selector_string, frequency
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_set_s_param_availability(
self, selector_string, s_parameter_availability
):
r"""Defines the S-Parameter availability.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s_parameter_availability (enums.CalkitManagerCalkitCalibrationElementSParameterAvailability, int):
This parameter specifies the S-Parameter availability.
+--------------+----------------------------------------+
| Name (Value) | Description |
+==============+========================================+
| Estimate (0) | S-Parameters treated as roughly known. |
+--------------+----------------------------------------+
| Known (1) | S-Parameters treated as exactly known. |
+--------------+----------------------------------------+
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")
s_parameter_availability = (
s_parameter_availability.value
if type(s_parameter_availability)
is enums.CalkitManagerCalkitCalibrationElementSParameterAvailability
else s_parameter_availability
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_set_s_param_availability( # type: ignore
updated_selector_string, s_parameter_availability
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_set_s11(self, selector_string, s11):
r"""Sets the S11 S-Parameter for the calibration element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s11 (numpy.complex128):
This parameter specifies the S11 S-Parameter for the calibration element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_set_s11( # type: ignore
updated_selector_string, s11
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_set_s12(self, selector_string, s12):
r"""Sets the S12 S-Parameter for the calibration element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s12 (numpy.complex128):
This parameter specifies the S12 S-Parameter for the calibration element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_set_s12( # type: ignore
updated_selector_string, s12
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_set_s21(self, selector_string, s21):
r"""Sets the S21 S-Parameter for the calibration element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s21 (numpy.complex128):
This parameter specifies the S21 S-Parameter for the calibration element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_set_s21( # type: ignore
updated_selector_string, s21
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_set_s22(self, selector_string, s22):
r"""Sets the S22 S-Parameter for the calibration element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s22 (numpy.complex128):
This parameter specifies the S22 S-Parameter for the calibration element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_set_s22( # type: ignore
updated_selector_string, s22
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_set_from_file(
self, selector_string, file_name
):
r"""Defines the touchstone file name from which the S-Parameter shall be read and assigned to the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
file_name (string):
This parameter specifies the touchstone file name.
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")
_helper.validate_not_none(file_name, "file_name")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_set_from_file( # type: ignore
updated_selector_string, file_name
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_measurement_memory_x_data(self, selector_string):
r"""Returns the X Data from the measurement memory specified by the selector string.
Args:
selector_string (string):
This parameter specifies a selector string comprising of measurement number and the measurement memory
name. You must specify the measurement
number and the measurement memory name.
Example:
"sparam0"
You can use the :py:meth:`build_measurement_memory_string` along with:py:meth:`build_s_parameter_string` method
to build the selector string.
Returns:
Tuple (measurement_memory_x, error_code):
measurement_memory_x (float):
This parameter returns the X Data from the measurement memory specified by the selector string.
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
)
measurement_memory_x, error_code = self._interpreter.get_measurement_memory_x_data( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return measurement_memory_x, error_code
@_raise_if_disposed
def get_measurement_memory_y_data(self, selector_string):
r"""Returns the Y Data from the measurement memory specified by the selector string.
Y value can be a real or a complex number depending on the format of the selected measurement. Y is a complex
number for Complex, Smith and Polar formats. For all other formats, Y is a real number. If Y value is a complex number,
Measurement Memory Y1 and Measurement Memory Y2 return its real and imaginary components respectively. If Y value is a
real number, Measurement Memory Y1 returns the real data and Measurement Memory Y2 returns an empty array.
Args:
selector_string (string):
This parameter specifies a selector string comprising of measurement number and the measurement memory
name. You must specify the measurement
number and the measurement memory name.
Example:
"sparam0"
You can use the :py:meth:`build_measurement_memory_string` along with:py:meth:`build_s_parameter_string` method
to build the selector string.
Returns:
Tuple (measurement_memory_y1, measurement_memory_y2, error_code):
measurement_memory_y1 (float):
This parameter returns Y1 Data array from the Measurement Memory.
measurement_memory_y2 (float):
This parameter returns Y2 Data array from the Measurement Memory.
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
)
measurement_memory_y1, measurement_memory_y2, error_code = self._interpreter.get_measurement_memory_y_data( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return measurement_memory_y1, measurement_memory_y2, error_code
@_raise_if_disposed
def calset_get_frequency_grid(self, selector_string, calset_name, error_term_identifier):
r"""Returns the calibration frequency grid from either the default calset of the specified signal or a named calset
accessible across all signals.
Behaviors for different combinations of Calset Name and Signal Name strings are as follows:
- Calset Name is "" (empty string): RFmx returns the calibration frequency grid from the default calset of the signal instance specified in the Selector String. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is non-empty string: If you do not specify a Signal Name, then RFmx returns the calibration frequency grid from the named calset. RFmx returns an error if you specify both Calset Name and Signal Name as non-empty strings.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
calset_name (string):
This parameter specifies the name of the calset. If you do not specify this parameter, the calset is saved as default
calset for the specified signal and is not available for use in other signals. If you specify non-empty Calset Name
string, calset is saved as a named calset available for use across all signals and is also selected as the active
calset for the current signal.
error_term_identifier (enums.CalFrequencyGrid, int):
This parameter specifies the type of error term in the calset.
The error term can take the following values:
+---------------------------+--------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===========================+============================================================================================+
| Directivity (0) | Directivity measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| Source Match (1) | Source Match measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| Reflection Tracking (2) | Reflection Tracking measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| Transmission Tracking (3) | Transmission Tracking measured at Measurement Port with Source Port being the source port. |
+---------------------------+--------------------------------------------------------------------------------------------+
| Load Match (4) | Load Match measured at Measurement Port with Source Port being the source port. |
+---------------------------+--------------------------------------------------------------------------------------------+
| K (5) | K measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| alpha (6) | alpha measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| beta (7) | beta measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| gamma (8) | gamma measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| delta (9) | delta measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| Switch Term (10) | Switch term measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
The error term K, alpha, beta, gamma, and delta describe the relation of the scattered and incident waves at
the calibration plane (denoted as waves a and b respectively) and the waves measured at VNA reference and test
receivers (denoted as waves r and s respectively) by the following equations:
a = K[alpha r + beta s]
b = K[gamma r + delta s]
, where alpha, beta, gamma, and delta represent the complex elements of a transmission matrix and K represents
a complex scaling factor.
Returns:
Tuple (frequency_grid, error_code):
frequency_grid (float):
This parameter returns the calibration frequency grid from the calset. 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()
_helper.validate_not_none(selector_string, "selector_string")
_helper.validate_not_none(calset_name, "calset_name")
error_term_identifier = (
error_term_identifier.value
if type(error_term_identifier) is enums.CalFrequencyGrid
else error_term_identifier
)
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
frequency_grid, error_code = self._interpreter.calset_get_frequency_grid( # type: ignore
updated_selector_string, calset_name, error_term_identifier
)
finally:
self._session_function_lock.exit_read_lock()
return frequency_grid, error_code
@_raise_if_disposed
def calset_get_error_term(
self,
selector_string,
calset_name,
error_term_identifier,
measurement_port,
source_port,
error_term,
):
r"""Returns values for a specific error term from either the default calset of the specified signal or a named calset
accessible across all signals.
Behaviors for different combinations of Calset Name and Signal Name strings are as follows:
- Calset Name is "" (empty string): RFmx returns the error term values from the default calset of the signal instance specified in the Selector String. If you do not specify a Signal Name, then default RFmxVNA signal instance is used.
- Calset Name is non-empty string: If you do not specify a Signal Name, then RFmx returns the error term values from the named calset. RFmx returns an error if you specify both Calset Name and Signal Name as non-empty strings.
Args:
selector_string (string):
Pass an empty string.
The signal name that is passed when creating the signal configuration is used.
calset_name (string):
This parameter specifies the name of the calset. If you do not specify this parameter, the calset is saved as default
calset for the specified signal and is not available for use in other signals. If you specify non-empty Calset Name
string, calset is saved as a named calset available for use across all signals and is also selected as the active
calset for the current signal.
error_term_identifier (enums.CalErrorTerm, int):
This parameter specifies the type of error term in the calset.
The error term can take the following values:
+---------------------------+--------------------------------------------------------------------------------------------+
| Name (Value) | Description |
+===========================+============================================================================================+
| Directivity (0) | Directivity measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| Source Match (1) | Source Match measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| Reflection Tracking (2) | Reflection Tracking measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| Transmission Tracking (3) | Transmission Tracking measured at Measurement Port with Source Port being the source port. |
+---------------------------+--------------------------------------------------------------------------------------------+
| Load Match (4) | Load Match measured at Measurement Port with Source Port being the source port. |
+---------------------------+--------------------------------------------------------------------------------------------+
| K (5) | K measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| alpha (6) | alpha measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| beta (7) | beta measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| gamma (8) | gamma measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| delta (9) | delta measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
| Switch Term (10) | Switch term measured at Measurement Port (Source Port ignored). |
+---------------------------+--------------------------------------------------------------------------------------------+
The error term K, alpha, beta, gamma, and delta describe the relation of the scattered and incident waves at
the calibration plane (denoted as waves a and b respectively) and the waves measured at VNA reference and test
receivers (denoted as waves r and s respectively) by the following equations:
a = K[alpha r + beta s]
b = K[gamma r + delta s]
, where alpha, beta, gamma, and delta represent the complex elements of a transmission matrix and K represents
a complex scaling factor.
measurement_port (string):
This parameter specifies the VNA port name corresponding to the **Error Term** you queried.
source_port (string):
This parameter specifies the VNA port name for which the **Error Term** is queried. This parameter is only required to
query Error Term defined by port pairs. The valid values of the parameter Error Term Identifier defined for port pairs
are **Transmission Tracking** and **Load Match**.
error_term (numpy.complex64):
This parameter returns the computed error term from the calset.
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")
_helper.validate_not_none(calset_name, "calset_name")
error_term_identifier = (
error_term_identifier.value
if type(error_term_identifier) is enums.CalErrorTerm
else error_term_identifier
)
_helper.validate_not_none(measurement_port, "measurement_port")
_helper.validate_not_none(source_port, "source_port")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
error_code = self._interpreter.calset_get_error_term( # type: ignore
updated_selector_string,
calset_name,
error_term_identifier,
measurement_port,
source_port,
error_term,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_get_trl_reference_plane(self, selector_string):
r"""Returns the calibration standard (Thru or Reflect) that is used to define the measurement reference plane for TRL
calibration.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (reference_plane, error_code):
reference_plane (enums.CalkitManagerCalkitTrlReferencePlane):
This parameter returns the TRL calibration standard (Thru or Reflect) used to define the reference plane.
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
)
reference_plane, error_code = self._interpreter.calkit_manager_calkit_get_trl_reference_plane( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return reference_plane, error_code
@_raise_if_disposed
def calkit_manager_calkit_get_lrl_line_auto_char(self, selector_string):
r"""Returns whether line parameters are automatically characterized during LRL calibration.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (auto_characterization_enabled, error_code):
auto_characterization_enabled (bool):
This parameter returns whether line parameters are automatically characterized during LRL calibration.
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
)
auto_characterization_enabled, error_code = self._interpreter.calkit_manager_calkit_get_lrl_line_auto_char( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return auto_characterization_enabled, error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_get_gender(self, selector_string):
r"""Returns the Gender of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (connector_gender, error_code):
connector_gender (enums.CalkitManagerCalkitConnectorGender):
This parameter returns the Gender of a Connector of a specific Calkit.
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
)
connector_gender, error_code = self._interpreter.calkit_manager_calkit_connector_get_gender( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return connector_gender, error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_get_impedance(self, selector_string):
r"""Returns the Impedance of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (impedance, error_code):
impedance (float):
This parameter returns the Impedance of a Connector of a specific Calkit.
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
)
impedance, error_code = self._interpreter.calkit_manager_calkit_connector_get_impedance( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return impedance, error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_get_minimum_frequency(self, selector_string):
r"""Returns the Minimum Frequency of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (minimum_frequency, error_code):
minimum_frequency (float):
This parameter returns the Minimum Frequency of a Connector of a specific Calkit.
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
)
minimum_frequency, error_code = self._interpreter.calkit_manager_calkit_connector_get_minimum_frequency( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return minimum_frequency, error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_get_maximum_frequency(self, selector_string):
r"""Returns the Maximum Frequency of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (maximum_frequency, error_code):
maximum_frequency (float):
This parameter returns the Maximum Frequency of a Connector of a specific Calkit.
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
)
maximum_frequency, error_code = self._interpreter.calkit_manager_calkit_connector_get_maximum_frequency( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return maximum_frequency, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_get_types(self, selector_string):
r"""Returns the type(s) of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (calibration_element_types, error_code):
calibration_element_types (enums.CalkitManagerCalkitCalibrationElementType):
This parameter returns the type(s) of the Calibration Element.
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
)
calibration_element_types, error_code = self._interpreter.calkit_manager_calkit_calibration_element_get_types( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return calibration_element_types, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_get_s_parameter_definition(self, selector_string):
r"""Returns the S-Parameter definition of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (s_parameter_definition, error_code):
s_parameter_definition (enums.CalkitManagerCalkitCalibrationElementSParameterDefinition):
This parameter returns the S-Parameter definition of the Calibration Element.
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
)
s_parameter_definition, error_code = self._interpreter.calkit_manager_calkit_calibration_element_get_s_parameter_definition( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return s_parameter_definition, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_get_minimum_frequency(self, selector_string):
r"""Returns the Minimum Frequency of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (minimum_frequency, error_code):
minimum_frequency (float):
This parameter returns the Minimum Frequency of the Calibration Element.
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
)
minimum_frequency, error_code = self._interpreter.calkit_manager_calkit_calibration_element_get_minimum_frequency( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return minimum_frequency, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_get_maximum_frequency(self, selector_string):
r"""Returns the Maximum Frequency of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (maximum_frequency, error_code):
maximum_frequency (float):
This parameter returns the Maximum Frequency of the Calibration Element.
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
)
maximum_frequency, error_code = self._interpreter.calkit_manager_calkit_calibration_element_get_maximum_frequency( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return maximum_frequency, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_model_type(
self, selector_string
):
r"""Returns the model type of of the 1-port reflect standard.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (model_type, error_code):
model_type (enums.CalkitManagerCalkitCalibrationElementReflectModelType):
This parameter returns the model type of of the 1-port reflect standard.
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
)
model_type, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_model_type( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return model_type, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_s_param_availability(
self, selector_string
):
r"""Returns the S-Parameter availability.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (s_parameter_availability, error_code):
s_parameter_availability (enums.CalkitManagerCalkitCalibrationElementReflectModelSParameterAvailability):
This parameter returns the S-Parameter availability.
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
)
s_parameter_availability, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_s_param_availability( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return s_parameter_availability, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_c0(self, selector_string):
r"""Returns the 0th order coefficient of the 3rd order polynomial capacitance/inductance model for the Reflect Open/Reflect
Short model type.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (c0, error_code):
c0 (float):
This parameter returns the 0th order coefficient of the 3rd order polynomial capacitance/inductance model for the
Reflect Open/Reflect Short model type.
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
)
c0, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_c0( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return c0, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_c1(self, selector_string):
r"""Returns the 1st order coefficient of the 3rd order polynomial capacitance/inductance model for the Reflect Open/Reflect
Short model type.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (c1, error_code):
c1 (float):
This parameter returns the 1st order coefficient of the 3rd order polynomial capacitance/inductance model for the
Reflect Open/Reflect Short model type.
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
)
c1, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_c1( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return c1, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_c2(self, selector_string):
r"""Returns the 2nd order coefficient of the 3rd order polynomial capacitance/inductance model for the Reflect Open/Reflect
Short model type.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (c2, error_code):
c2 (float):
This parameter returns the 2nd order coefficient of the 3rd order polynomial capacitance/inductance model for the
Reflect Open/Reflect Short model type.
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
)
c2, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_c2( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return c2, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_c3(self, selector_string):
r"""Returns the 3rd order coefficient of the 3rd order polynomial capacitance/inductance model for the Reflect Open/Reflect
Short model type.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (c3, error_code):
c3 (float):
This parameter returns the 3rd order coefficient of the 3rd order polynomial capacitance/inductance model for the
Reflect Open/Reflect Short model type.
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
)
c3, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_c3( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return c3, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_offset_delay(
self, selector_string
):
r"""Returns the offset delay.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (offset_delay, error_code):
offset_delay (float):
This parameter returns the offset delay.
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
)
offset_delay, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_offset_delay( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return offset_delay, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_offset_loss(
self, selector_string
):
r"""Returns the offset loss.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (offset_loss, error_code):
offset_loss (float):
This parameter returns the offset loss.
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
)
offset_loss, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_offset_loss( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return offset_loss, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_offset_z0(
self, selector_string
):
r"""Returns the impedance of the offset.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (offset_z0, error_code):
offset_z0 (float):
This parameter returns the impedance of the 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()
_helper.validate_not_none(selector_string, "selector_string")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
offset_z0, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_offset_z0( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return offset_z0, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_reflect_model_get_reference_impedance(
self, selector_string
):
r"""Returns the reference impedance.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (reference_impedance, error_code):
reference_impedance (float):
This parameter returns the reference impedance.
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
)
reference_impedance, error_code = self._interpreter.calkit_manager_calkit_calibration_element_reflect_model_get_reference_impedance( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return reference_impedance, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_delay_model_get_delay(self, selector_string):
r"""Returns the Delay of a Calibration Element defined by the Delay Model.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (delay, error_code):
delay (float):
This parameter returns the Delay of a Calibration Element defined by the Delay Model.
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
)
delay, error_code = self._interpreter.calkit_manager_calkit_calibration_element_delay_model_get_delay( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return delay, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_get_frequency(self, selector_string):
r"""Returns the frequency array for the S-Parameter definition of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (frequency, error_code):
frequency (float):
This parameter returns the frequency array for the S-Parameter definition of the Calibration Element.
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
)
frequency, error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_get_frequency( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return frequency, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_get_s_param_availability(
self, selector_string
):
r"""Returns the S-Parameter availability.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (s_parameter_availability, error_code):
s_parameter_availability (enums.CalkitManagerCalkitCalibrationElementSParameterAvailability):
This parameter returns the S-Parameter availability.
+--------------+----------------------------------------+
| Name (Value) | Description |
+==============+========================================+
| Estimate (0) | S-Parameters treated as roughly known. |
+--------------+----------------------------------------+
| Known (1) | S-Parameters treated as exactly known. |
+--------------+----------------------------------------+
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
)
s_parameter_availability, error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_get_s_param_availability( # type: ignore
updated_selector_string
)
finally:
self._session_function_lock.exit_read_lock()
return s_parameter_availability, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_get_s11(self, selector_string, s11):
r"""Returns the S11 S-Parameter for the calibration element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s11 (numpy.complex128):
This parameter returns the S11 S-Parameter for the calibration element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_get_s11( # type: ignore
updated_selector_string, s11
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_get_s12(self, selector_string, s12):
r"""Returns the S12 S-Parameter for the calibration element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s12 (numpy.complex128):
This parameter returns the S12 S-Parameter for the calibration element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_get_s12( # type: ignore
updated_selector_string, s12
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_get_s21(self, selector_string, s21):
r"""Returns the S21 S-Parameter for the calibration element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s21 (numpy.complex128):
This parameter returns the S21 S-Parameter for the calibration element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_get_s21( # type: ignore
updated_selector_string, s21
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_s_parameter_get_s22(self, selector_string, s22):
r"""Returns the S22 S-Parameter for the calibration element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
s22 (numpy.complex128):
This parameter returns the S22 S-Parameter for the calibration element.
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
)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_s_parameter_get_s22( # type: ignore
updated_selector_string, s22
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@staticmethod
def build_result_string(result_name):
r"""Creates selector string for use with configuration or fetch.
Args:
result_name (string):
Specifies the result name for building the selector string.
This input accepts the result name with or without the "result::" prefix.
Example: "", "result::r1", "r1".
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(result_name, "result_name")
return _helper.build_result_string(result_name)
@staticmethod
def build_port_string(selector_string, port_string):
r"""Creates selector string specifying the port(s) for use with configuration or fetch attributes and methods.
Args:
selector_string (string):
Specifies the result name for building the selector string.
port_string (string):
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_port_string(selector_string, port_string) # type: ignore
@staticmethod
def build_segment_string(selector_string, segment_number):
r"""Creates a selector string specifying the segment number for use with configuration or fetch attributes and methods.
Args:
selector_string (string):
Specifies the result name for building the selector string.
segment_number (int):
This parameter specifies the segment for building the selector string.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_segment_string(selector_string, segment_number) # type: ignore
@staticmethod
def build_s_parameter_string(selector_string, s_parameter_number):
r"""Creates the selector string to use with S-Parameter configuration or fetch attributes and methods.
Args:
selector_string (string):
Specifies the result name for building the selector string.
s_parameter_number (int):
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_s_parameter_string(selector_string, s_parameter_number) # type: ignore
@staticmethod
def build_wave_string(selector_string, wave_number):
r"""Creates the selector string to use with Wave configuration or fetch attributes and methods.
Args:
selector_string (string):
Specifies the result name for building the selector string.
wave_number (int):
This parameter specifies the wave index for building the selector string.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_wave_string(selector_string, wave_number) # type: ignore
@staticmethod
def build_calstep_string(selector_string, calstep_number):
r"""Creates the calibration step string to use as the selector string with the :py:meth:`calibration_acquire` method.
Args:
selector_string (string):
Specifies the result name for building the selector string.
calstep_number (int):
This parameter specifies the calibration step number for building the selector string.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_calstep_string(selector_string, calstep_number) # type: ignore
@staticmethod
def build_calkit_string(selector_string, calkit_id):
r"""Creates a selector string specifying the Calkit.
Args:
selector_string (string):
Specifies the result name for building the selector string.
calkit_id (string):
This parameter specifies the ID for the Calkit in Calkit Manager.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_calkit_string(selector_string, calkit_id) # type: ignore
@staticmethod
def build_connector_string(selector_string, connector_id):
r"""Creates a selector string specifying the Connector within the Calkit.
Args:
selector_string (string):
Specifies the result name for building the selector string.
connector_id (string):
This parameter specifies the ID of the Connector within the Calkit.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_connector_string(selector_string, connector_id) # type: ignore
@staticmethod
def build_calibration_element_string(selector_string, calibration_element_id):
r"""Creates a selector string specifying the Calibration Element within the Calkit.
Args:
selector_string (string):
Specifies the result name for building the selector string.
calibration_element_id (string):
This parameter specifies the ID of the Calibration Element within the Calkit.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_calibration_element_string(selector_string, calibration_element_id) # type: ignore
@staticmethod
def build_pulse_generator_string(selector_string, pulse_generator_number):
r"""Creates the selector string specifying the Pulse Generator for use with configuration or fetch attributes.
Args:
selector_string (string):
Specifies the result name for building the selector string.
pulse_generator_number (int):
This parameter specifies the pulse generator index for building the selector string.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_pulse_generator_string(selector_string, pulse_generator_number) # type: ignore
@staticmethod
def build_marker_string(selector_string, marker_number):
r"""Creates selector string for use with marker configuration or fetch attributes and methods.
Args:
selector_string (string):
Specifies the result name for building the selector string.
marker_number (int):
This parameter specifies the marker number for building the selector string.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_marker_string(selector_string, marker_number) # type: ignore
@staticmethod
def build_measurement_memory_string(selector_string, measurement_memory_name):
r"""Creates selector string specifying the measurement memory name for use with the get methods.
Args:
selector_string (string):
Specifies the result name for building the selector string.
measurement_memory_name (string):
This parameter Measurement Memory Name specifies the name to associate with the data you load to the measurement
memory. Provide a unique name.
Returns:
string:
Contains the selector string created by this method.
"""
_helper.validate_not_none(selector_string, "selector_string")
return _helper.build_measurement_memory_string(selector_string, measurement_memory_name) # type: ignore
@_raise_if_disposed
def clone_signal_configuration(self, new_signal_name):
r"""Creates a new instance of a signal by copying all the attribute values from an existing signal instance.
Args:
new_signal_name (string):
This parameter specifies the name of the new signal. This parameter accepts the signal name with or without the \"signal::\" prefix.
Example:
\"signal::NewSigName\"
\"NewSigName\"
Returns:
Tuple (cloned_signal, error_code):
cloned_signal (vna):
Contains a new VNA signal instance.
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(new_signal_name, "new_signal_name")
updated_new_signal_name = _helper.validate_and_remove_signal_qualifier(
new_signal_name, self
)
cloned_signal, error_code = self._interpreter.clone_signal_configuration( # type: ignore
self.signal_configuration_name, updated_new_signal_name
)
finally:
self._session_function_lock.exit_read_lock()
return cloned_signal, error_code
@_raise_if_disposed
def send_software_edge_trigger(self):
r"""Sends a trigger to the device when you use the Configure Trigger function to choose a software version of a trigger and the device is waiting for the trigger to be sent. You can also use this function to override a hardware trigger.
This function returns an error in the following situations:
- You configure an invalid trigger.
- You have not previously called the initiate function.
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()
error_code = self._interpreter.send_software_edge_trigger() # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_all_named_result_names(self, selector_string):
r"""Returns all the named result names of the signal that you specify in the Selector String parameter.
Args:
selector_string (string):
Pass an empty string. The signal name that is passed when creating the signal configuration is used.
Returns:
Tuple (result_names, default_result_exists, error_code):
result_names (string):
Returns an array of result names.
default_result_exists (bool):
Indicates whether the default result exists.
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
)
result_names, default_result_exists, error_code = (
self._interpreter.get_all_named_result_names(updated_selector_string) # type: ignore
)
finally:
self._session_function_lock.exit_read_lock()
return result_names, default_result_exists, error_code
@_raise_if_disposed
def calkit_manager_calkit_get_description(self, selector_string):
r"""Returns the description of the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (calkit_description, error_code):
calkit_description (string):
This parameter returns the description of the Calkit.
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
)
calkit_description, error_code = (
self._interpreter.calkit_manager_calkit_get_description(updated_selector_string) # type: ignore
)
finally:
self._session_function_lock.exit_read_lock()
return calkit_description, error_code
@_raise_if_disposed
def calkit_manager_calkit_get_version(self, selector_string):
r"""Returns the version string of the Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (calkit_version, error_code):
calkit_version (string):
This parameter returns the version string of the Calkit.
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
)
calkit_version, error_code = self._interpreter.calkit_manager_calkit_get_version(
updated_selector_string
) # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return calkit_version, error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_get_description(self, selector_string):
r"""Returns the description of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (description, error_code):
description (string):
This parameter returns the description for a Connector of a specific Calkit.
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
)
description, error_code = (
self._interpreter.calkit_manager_calkit_connector_get_description(updated_selector_string) # type: ignore
)
finally:
self._session_function_lock.exit_read_lock()
return description, error_code
@_raise_if_disposed
def calkit_manager_calkit_connector_get_type(self, selector_string):
r"""Returns the Type of a Connector of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (connector_type, error_code):
connector_type (string):
This parameter returns the Type of a Connector of a specific Calkit.
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
)
connector_type, error_code = self._interpreter.calkit_manager_calkit_connector_get_type(
updated_selector_string
) # type: ignore
finally:
self._session_function_lock.exit_read_lock()
return connector_type, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_get_description(self, selector_string):
r"""Returns the description for a Calibration Element of a specific Calkit.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
Returns:
Tuple (description, error_code):
description (string):
This parameter returns the description for a Calibration Element of a specific Calkit.
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
)
description, error_code = (
self._interpreter.calkit_manager_calkit_calibration_element_get_description(updated_selector_string) # type: ignore
)
finally:
self._session_function_lock.exit_read_lock()
return description, error_code
@_raise_if_disposed
def calkit_manager_calkit_calibration_element_set_port_connectors(
self, selector_string, connector_ids
):
r"""Defines the connectors of the Calibration Element by providing an array of Connector IDs where the 1st array element
refers to the connector of the 1st port of the Calibration element. The array size has to be equal to the number of
ports of the Calibration Element.
Args:
selector_string (string):
Specifies a selector string. Pass an empty string.
connector_ids (string):
This parameter specifies the array of Connectors associated with the Calibration Element.
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")
_helper.validate_not_none(connector_ids, "connector_ids")
updated_selector_string = _helper.validate_and_update_selector_string(
selector_string, self
)
connector_ids = _helper.create_comma_separated_string(connector_ids)
error_code = self._interpreter.calkit_manager_calkit_calibration_element_set_port_connectors( # type: ignore
updated_selector_string, connector_ids
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
@_raise_if_disposed
def get_correction_calibration_ports(self, selector_string):
r"""Gets the ports requested for calibration. Use comma-separated list of ports to specify multiple ports.
Args:
selector_string (string):
Specifies a selector string containing physical channel names and/or signal names. If only a signal name is specified, then the function returns the calibration ports for that signal.
Returns:
Tuple (ports, error_code):
ports (list of string):
Returns an array of port names used for calibration.
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
)
ports, error_code = self._interpreter.get_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_PORTS.value,
)
ports = _helper.split_string_by_comma(ports)
finally:
self._session_function_lock.exit_read_lock()
return ports, error_code
@_raise_if_disposed
def set_correction_calibration_ports(self, selector_string, ports):
r"""Sets the ports requested for calibration. Use comma-separated list of ports to specify multiple ports.
Args:
selector_string (string):
Specifies a selector string containing physical channel names and/or signal names. If only a signal name is specified, then the function sets the calibration ports for that signal.
ports (list of string):
Specifies an array of port names to use for calibration.
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
)
ports = _helper.create_comma_separated_string(ports)
error_code = self._interpreter.set_attribute_string( # type: ignore
updated_selector_string,
attributes.AttributeID.CORRECTION_CALIBRATION_PORTS.value,
ports,
)
finally:
self._session_function_lock.exit_read_lock()
return error_code
[docs]
class Vna(_VnaBase):
"""Defines a root class which is used to identify and control Vna signal configuration."""
def __init__(self, session, signal_name="", cloning=False):
"""Initializes a Vna signal configuration."""
super(Vna, self).__init__(
session=session,
signal_name=signal_name,
cloning=cloning,
) # type: ignore
def __enter__(self):
"""Enters the context of the Vna signal configuration."""
return self
def __exit__(self, exc_type, exc_value, traceback):
"""Exits the context of the Vna signal configuration."""
self.dispose() # type: ignore
pass