Source code for rsrtx.Implementations.Gpib

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


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

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

	# noinspection PyTypeChecker
[docs] def get_terminator(self) -> enums.GpibTerminator: """ ``GPIB:TERMinator`` \n Snippet: ``value: enums.GpibTerminator = driver.gpib.get_terminator()`` \n Specifies the symbol that is used as a terminator in GPIB communication. :return: terminator: LFEoi | EOI """ response = self._core.io.query_str_with_opc('GPIB:TERMinator?') return Conversions.str_to_scalar_enum(response, enums.GpibTerminator)
[docs] def set_terminator(self, terminator: enums.GpibTerminator) -> None: """ ``GPIB:TERMinator`` \n Snippet: ``driver.gpib.set_terminator(terminator = enums.GpibTerminator.EOI)`` \n Specifies the symbol that is used as a terminator in GPIB communication. :param terminator: LFEoi | EOI """ param = Conversions.enum_scalar_to_str(terminator, enums.GpibTerminator) self._core.io.write_with_opc(f'GPIB:TERMinator {param}')
[docs] def get_address(self) -> int: """ ``GPIB:ADDRess`` \n Snippet: ``value: int = driver.gpib.get_address()`` \n Sets the GPIB address of the instrument. Changing the address has major effects on the communication to the remote computer. :return: address: 0 to 30 """ response = self._core.io.query_str_with_opc('GPIB:ADDRess?') return Conversions.str_to_int(response)
[docs] def set_address(self, address: int) -> None: """ ``GPIB:ADDRess`` \n Snippet: ``driver.gpib.set_address(address = 1)`` \n Sets the GPIB address of the instrument. Changing the address has major effects on the communication to the remote computer. :param address: 0 to 30 """ param = Conversions.decimal_value_to_str(address) self._core.io.write_with_opc(f'GPIB:ADDRess {param}')