Source code for rsrtx.Implementations.Digital.Threshold

from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ThresholdCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("threshold", core, parent)

[docs] def set(self, value: float, digitalNull=repcap.DigitalNull.Default) -> None: """ ``DIGital<*>:THReshold`` \n Snippet: ``driver.digital.threshold.set(value = 1.0, digitalNull = repcap.DigitalNull.Default)`` \n Sets the logical threshold for the channel group to which the indicated digital channel belongs. The setting affects only the settings of the first MSO bus (Bus1) . The setting affects only the settings of the first MSO bus (Bus1) . You can set the threshold for all buses with method ``RsRtx.bus.parallel.technology.set()`` or BUS<bb>:PARallel:THReshold<n>. See also: method ``RsRtx.digital.thCoupling.set()`` :param value: -8.0 to 8.0 :param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital') """ param = Conversions.decimal_value_to_str(value) digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull) self._core.io.write(f'DIGital{digitalNull_cmd_val}:THReshold {param}')
[docs] def get(self, digitalNull=repcap.DigitalNull.Default) -> float: """ ``DIGital<*>:THReshold`` \n Snippet: ``value: float = driver.digital.threshold.get(digitalNull = repcap.DigitalNull.Default)`` \n Sets the logical threshold for the channel group to which the indicated digital channel belongs. The setting affects only the settings of the first MSO bus (Bus1) . The setting affects only the settings of the first MSO bus (Bus1) . You can set the threshold for all buses with method ``RsRtx.bus.parallel.technology.set()`` or BUS<bb>:PARallel:THReshold<n>. See also: method ``RsRtx.digital.thCoupling.set()`` :param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital') :return: value: -8.0 to 8.0 """ digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull) response = self._core.io.query_str(f'DIGital{digitalNull_cmd_val}:THReshold?') return Conversions.str_to_float(response)