Source code for rsrtx.Implementations.Channel.Coupling

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


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

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

[docs] def set(self, value: enums.ChannelCoupling, channel=repcap.Channel.Default) -> None: """ ``CHANnel<*>:COUPling`` \n Snippet: ``driver.channel.coupling.set(value = enums.ChannelCoupling.AC, channel = repcap.Channel.Default)`` \n Selects the connection of the indicated channel signal. :param value: DC | DCLimit | AC \n - DC: Direct connection with 50 Ω termination, passes both DC and AC components. - DCLimit: Direct connection with 1 MΩ termination, passes both DC and AC components.Only available if the 1 MΩ adapter is used. - AC: Connection with 1 MΩ termination, removes DC and very low-frequency components.Only available if the 1 MΩ adapter is used. :param channel: optional repeated capability selector. Default value: Ch1 (settable in the interface 'Channel') """ param = Conversions.enum_scalar_to_str(value, enums.ChannelCoupling) channel_cmd_val = self._cmd_group.get_repcap_cmd_value(channel, repcap.Channel) self._core.io.write(f'CHANnel{channel_cmd_val}:COUPling {param}')
# noinspection PyTypeChecker
[docs] def get(self, channel=repcap.Channel.Default) -> enums.ChannelCoupling: """ ``CHANnel<*>:COUPling`` \n Snippet: ``value: enums.ChannelCoupling = driver.channel.coupling.get(channel = repcap.Channel.Default)`` \n Selects the connection of the indicated channel signal. :param channel: optional repeated capability selector. Default value: Ch1 (settable in the interface 'Channel') :return: value: DC | DCLimit | AC \n - DC: Direct connection with 50 Ω termination, passes both DC and AC components. - DCLimit: Direct connection with 1 MΩ termination, passes both DC and AC components.Only available if the 1 MΩ adapter is used. - AC: Connection with 1 MΩ termination, removes DC and very low-frequency components.Only available if the 1 MΩ adapter is used. """ channel_cmd_val = self._cmd_group.get_repcap_cmd_value(channel, repcap.Channel) response = self._core.io.query_str(f'CHANnel{channel_cmd_val}:COUPling?') return Conversions.str_to_scalar_enum(response, enums.ChannelCoupling)