From 06cc1433634c474f21c7009de23d78e00f8a8fc1 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Mon, 28 Sep 2020 17:56:03 -0400 Subject: [PATCH 01/13] gpib: send the proper byte when using command --- pyvisa_py/gpib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index e2e7605d..c33f92a5 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -454,7 +454,7 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: try: if mode == constants.VI_GPIB_REN_DEASSERT_GTL: # Send GTL command byte (cf linux-gpib documentation) - ifc.command(chr(1)) + ifc.command(b"\x01") if mode in ( constants.VI_GPIB_REN_DEASSERT, constants.VI_GPIB_REN_DEASSERT_GTL, @@ -463,10 +463,10 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: if mode == constants.VI_GPIB_REN_ASSERT_LLO: # LLO - ifc.command(b"0x11") + ifc.command(b"\x11") elif mode == constants.VI_GPIB_REN_ADDRESS_GTL: # GTL - ifc.command(b"0x1") + ifc.command(b"\x01") elif mode == constants.VI_GPIB_REN_ASSERT_ADDRESS_LLO: pass elif mode in ( From 669608e2e064ff160cbc0799bc6517c07d067bab Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Mon, 28 Sep 2020 18:16:56 -0400 Subject: [PATCH 02/13] =?UTF-8?q?=EF=BB=BFupdate=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 5b831bf7..f986f068 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ PyVISA-py Changelog =================== +0.8.0 (unreleased) +------------------ + +- fix GPIB commands used in control_ren implementation PR #276 + 0.7.1 (26/10/2023) ------------------ From 13316cedefd7ca7e350b36f02645b57c3f3b76cc Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Tue, 29 Sep 2020 18:19:41 -0400 Subject: [PATCH 03/13] gpib: use board controller as appropriate in gpib_control_ren --- pyvisa_py/gpib.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index c33f92a5..c0d20ed8 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -449,12 +449,12 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: ): return constants.StatusCode.error_nonsupported_operation - # INTFC don't have an interface so use the controller - ifc = self.interface or self.controller + # Commands and remote enable operation are common to the whole bus and + # are hence handled by the board (ie self.controller) try: if mode == constants.VI_GPIB_REN_DEASSERT_GTL: # Send GTL command byte (cf linux-gpib documentation) - ifc.command(b"\x01") + self.controller.command(b"\x01") if mode in ( constants.VI_GPIB_REN_DEASSERT, constants.VI_GPIB_REN_DEASSERT_GTL, @@ -463,23 +463,24 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: if mode == constants.VI_GPIB_REN_ASSERT_LLO: # LLO - ifc.command(b"\x11") + self.controller.command(b"\x11") elif mode == constants.VI_GPIB_REN_ADDRESS_GTL: # GTL - ifc.command(b"\x01") + self.controller.command(b"\x01") elif mode == constants.VI_GPIB_REN_ASSERT_ADDRESS_LLO: pass elif mode in ( constants.VI_GPIB_REN_ASSERT, constants.VI_GPIB_REN_ASSERT_ADDRESS, ): - ifc.remote_enable(1) + self.controller.remote_enable(1) if ( isinstance(self.parsed, GPIBInstr) and mode == constants.VI_GPIB_REN_ASSERT_ADDRESS ): + # GPIBINstr have a valid interface # 0 for the secondary address means don't use it - ifc.listener( + self.interface.listener( self.parsed.primary_address, self.parsed.secondary_address ) except gpib.GpibError as e: From 0fb86e477004156ce729a5c12681f286de22e762 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Wed, 30 Sep 2020 19:53:41 -0400 Subject: [PATCH 04/13] gpib: try to fix control_ren --- pyvisa_py/gpib.py | 61 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index c0d20ed8..cbe5d698 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -8,6 +8,7 @@ """ import ctypes # Used for missing bindings not ideal from bisect import bisect +from enum import Enum from typing import Any, Iterator, List, Tuple, Union from pyvisa import attributes, constants, logger @@ -76,6 +77,27 @@ def _inner(self): _patch_Gpib() +class GPIBCommand(bytes, Enum): + """GPIB commands to use in send_command.""" + + #: + GTL = b"\x01" + + #: + LLO = b"\x11" + + #: + UNL = b"\x5F" + + @staticmethod + def MTA(board_pad): + return chr(40 + board_pad) + + @staticmethod + def MLA(board_pad): + return chr(20 + board_pad) + + def _find_boards() -> Iterator[Tuple[int, int]]: """Find GPIB board addresses.""" for board in range(16): @@ -453,8 +475,12 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: # are hence handled by the board (ie self.controller) try: if mode == constants.VI_GPIB_REN_DEASSERT_GTL: - # Send GTL command byte (cf linux-gpib documentation) - self.controller.command(b"\x01") + # Make the instrument Go To Local + # Using ibloc is a nice way to avoid manually sending all the + # right commands but under the hood it does send GTL to the + # proper device. + # Only for INSTR hence sel.interface exists + self.interface.ibloc() if mode in ( constants.VI_GPIB_REN_DEASSERT, constants.VI_GPIB_REN_DEASSERT_GTL, @@ -462,13 +488,27 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: self.controller.remote_enable(0) if mode == constants.VI_GPIB_REN_ASSERT_LLO: - # LLO + # Send LLO to all devices addressed to listen as per the + # specification. self.controller.command(b"\x11") elif mode == constants.VI_GPIB_REN_ADDRESS_GTL: - # GTL - self.controller.command(b"\x01") + # Make the instrument Go To Local + # Using ibloc is a nice way to avoid manually sending all the + # right commands but under the hood it does send GTL to the + # proper device. + # Only fro INSTR hence sel.interface exists + self.interface.ibloc() elif mode == constants.VI_GPIB_REN_ASSERT_ADDRESS_LLO: - pass + # Make the board teh controller, unlisten all devices, address + # the target device and send LLO + # Closely inspired from linux-glib implementation of ibloc + # XXX handle secondary address + self.controller.command( + GPIBCommand.MTA(int(self.controller.parsed.primary_address)) + + GPIBCommand.UNL + + GPIBCommand.MLA(int(self.interface.parsed.primary_address)) + + GPIBCommand.LLO + ) elif mode in ( constants.VI_GPIB_REN_ASSERT, constants.VI_GPIB_REN_ASSERT_ADDRESS, @@ -478,10 +518,11 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: isinstance(self.parsed, GPIBInstr) and mode == constants.VI_GPIB_REN_ASSERT_ADDRESS ): - # GPIBINstr have a valid interface - # 0 for the secondary address means don't use it - self.interface.listener( - self.parsed.primary_address, self.parsed.secondary_address + # Address teh specified device, + # XXX handle secondary address + self.controller.command( + GPIBCommand.UNL + + GPIBCommand.MLA(int(self.interface.parsed.primary_address)) ) except gpib.GpibError as e: return convert_gpib_error(e, self.interface.ibsta(), "perform control REN") From 247e372e61d1a4c69913cf12c28b51aad6aa4fe1 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Wed, 30 Sep 2020 22:03:08 -0400 Subject: [PATCH 05/13] gpib: handle device secondary address --- pyvisa_py/gpib.py | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index cbe5d698..57aff3d2 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -80,22 +80,32 @@ def _inner(self): class GPIBCommand(bytes, Enum): """GPIB commands to use in send_command.""" - #: + #: GO TO LOCAL affects only addressed devices GTL = b"\x01" - #: + #: LOCAL LOCKOUT LLO = b"\x11" - #: + #: UNLISTEN UNL = b"\x5F" + # Talker @staticmethod def MTA(board_pad): return chr(40 + board_pad) + # Listener @staticmethod - def MLA(board_pad): - return chr(20 + board_pad) + def MLA(device_pad): + return chr(20 + device_pad) + + # Listener secondary address + # for VISA SAD range from 1 to 31 and 0 is not SAD + @staticmethod + def MSA(device_sad): + if device_sad == 0: + return b"" + return chr(95 + device_sad) def _find_boards() -> Iterator[Tuple[int, int]]: @@ -499,14 +509,18 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: # Only fro INSTR hence sel.interface exists self.interface.ibloc() elif mode == constants.VI_GPIB_REN_ASSERT_ADDRESS_LLO: - # Make the board teh controller, unlisten all devices, address + # Make the board the controller, unlisten all devices, address # the target device and send LLO - # Closely inspired from linux-glib implementation of ibloc - # XXX handle secondary address + # Closely inspired from linux-glib implementation of ibloc but + # in the VISA spec the board cannot have a secondary address + board_pad = int(self.controller.parsed.primary_address) + device_pad = int(self.interface.parsed.primary_address) + device_sad = int(self.interface.parsed.secondary_address) self.controller.command( - GPIBCommand.MTA(int(self.controller.parsed.primary_address)) + GPIBCommand.MTA(board_pad) + GPIBCommand.UNL - + GPIBCommand.MLA(int(self.interface.parsed.primary_address)) + + GPIBCommand.MLA(device_pad) + + GPIBCommand.MSA(device_sad) + GPIBCommand.LLO ) elif mode in ( @@ -519,10 +533,12 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: and mode == constants.VI_GPIB_REN_ASSERT_ADDRESS ): # Address teh specified device, - # XXX handle secondary address + device_pad = int(self.interface.parsed.primary_address) + device_sad = int(self.interface.parsed.secondary_address) self.controller.command( GPIBCommand.UNL - + GPIBCommand.MLA(int(self.interface.parsed.primary_address)) + + GPIBCommand.MLA(device_pad) + + GPIBCommand.MSA(device_sad) ) except gpib.GpibError as e: return convert_gpib_error(e, self.interface.ibsta(), "perform control REN") From 8baabf3ed661076d3e34e28e7ad5213eb8f47839 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Wed, 30 Sep 2020 22:07:46 -0400 Subject: [PATCH 06/13] gpib: fix command value --- pyvisa_py/gpib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index 57aff3d2..d3e9de28 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -87,7 +87,7 @@ class GPIBCommand(bytes, Enum): LLO = b"\x11" #: UNLISTEN - UNL = b"\x5F" + UNL = b"\x3F" # Talker @staticmethod From b19ec3942993b7962e37b98fd2350b77f9eebc4a Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Wed, 30 Sep 2020 22:18:15 -0400 Subject: [PATCH 07/13] gpib: fix int to bytes conversion --- pyvisa_py/gpib.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index d3e9de28..b3a54209 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -16,6 +16,7 @@ from pyvisa.rname import GPIBInstr, GPIBIntfc from .sessions import Session, UnknownAttribute +from .common import int_to_byte try: GPIB_CTYPES = True @@ -91,21 +92,21 @@ class GPIBCommand(bytes, Enum): # Talker @staticmethod - def MTA(board_pad): - return chr(40 + board_pad) + def MTA(board_pad) -> bytes: + return int_to_byte(40 + board_pad) # Listener @staticmethod - def MLA(device_pad): - return chr(20 + device_pad) + def MLA(device_pad) -> bytes: + return int_to_byte(20 + device_pad) # Listener secondary address # for VISA SAD range from 1 to 31 and 0 is not SAD @staticmethod - def MSA(device_sad): + def MSA(device_sad) -> bytes: if device_sad == 0: return b"" - return chr(95 + device_sad) + return int_to_byte(95 + device_sad) def _find_boards() -> Iterator[Tuple[int, int]]: From 48328ceacd0cd0db46b7f9e8c651f81ef3576631 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Tue, 14 Nov 2023 12:28:03 +0100 Subject: [PATCH 08/13] gpib: fix handling of addresses in control ren --- pyvisa_py/gpib.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index b3a54209..b5e99411 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -418,9 +418,11 @@ def read(self, count: int) -> Tuple[bytes, StatusCode]: ifc = self.interface or self.controller # END 0x2000 - checker = lambda current: ifc.ibsta() & 0x2000 + def checker(current): + return ifc.ibsta() & 0x2000 - reader = lambda: ifc.read(count) + def reader(): + return lambda: ifc.read(count) return self._read(reader, count, checker, False, None, False, gpib.GpibError) @@ -514,9 +516,9 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: # the target device and send LLO # Closely inspired from linux-glib implementation of ibloc but # in the VISA spec the board cannot have a secondary address - board_pad = int(self.controller.parsed.primary_address) - device_pad = int(self.interface.parsed.primary_address) - device_sad = int(self.interface.parsed.secondary_address) + board_pad = int(self.controller.ask(0x1)) # Request PAD of controller + device_pad = int(self.parsed.primary_address) + device_sad = int(self.parsed.secondary_address) self.controller.command( GPIBCommand.MTA(board_pad) + GPIBCommand.UNL @@ -533,9 +535,9 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: isinstance(self.parsed, GPIBInstr) and mode == constants.VI_GPIB_REN_ASSERT_ADDRESS ): - # Address teh specified device, - device_pad = int(self.interface.parsed.primary_address) - device_sad = int(self.interface.parsed.secondary_address) + # Address the specified device, + device_pad = int(self.parsed.primary_address) + device_sad = int(self.parsed.secondary_address) self.controller.command( GPIBCommand.UNL + GPIBCommand.MLA(device_pad) From 58e5b7f43d7ba99e57b01cd0c092f13c4703b2b0 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Tue, 14 Nov 2023 12:33:42 +0100 Subject: [PATCH 09/13] gpib: more fixes --- pyvisa_py/gpib.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index b5e99411..a11dbfce 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -15,8 +15,8 @@ from pyvisa.constants import ResourceAttribute, StatusCode from pyvisa.rname import GPIBInstr, GPIBIntfc -from .sessions import Session, UnknownAttribute from .common import int_to_byte +from .sessions import Session, UnknownAttribute try: GPIB_CTYPES = True @@ -512,13 +512,18 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: # Only fro INSTR hence sel.interface exists self.interface.ibloc() elif mode == constants.VI_GPIB_REN_ASSERT_ADDRESS_LLO: + assert isinstance(self.parsed, GPIBInstr) # Make the board the controller, unlisten all devices, address # the target device and send LLO # Closely inspired from linux-glib implementation of ibloc but # in the VISA spec the board cannot have a secondary address board_pad = int(self.controller.ask(0x1)) # Request PAD of controller device_pad = int(self.parsed.primary_address) - device_sad = int(self.parsed.secondary_address) + device_sad = ( + int(self.parsed.secondary_address) + if self.parsed.secondary_address is not None + else 0 + ) self.controller.command( GPIBCommand.MTA(board_pad) + GPIBCommand.UNL @@ -537,7 +542,11 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: ): # Address the specified device, device_pad = int(self.parsed.primary_address) - device_sad = int(self.parsed.secondary_address) + device_sad = ( + int(self.parsed.secondary_address) + if self.parsed.secondary_address is not None + else 0 + ) self.controller.command( GPIBCommand.UNL + GPIBCommand.MLA(device_pad) From 933ed7eadd230179f3230a554ebd1f85ba1c37b5 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Mon, 18 Dec 2023 18:44:39 +0100 Subject: [PATCH 10/13] gpib: grab GPIBCommands definition from pyvisa --- pyvisa_py/gpib.py | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index a11dbfce..11281ecd 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -14,6 +14,7 @@ from pyvisa import attributes, constants, logger from pyvisa.constants import ResourceAttribute, StatusCode from pyvisa.rname import GPIBInstr, GPIBIntfc +from pyvisa.resources.gpib import GPIBCommand from .common import int_to_byte from .sessions import Session, UnknownAttribute @@ -78,37 +79,6 @@ def _inner(self): _patch_Gpib() -class GPIBCommand(bytes, Enum): - """GPIB commands to use in send_command.""" - - #: GO TO LOCAL affects only addressed devices - GTL = b"\x01" - - #: LOCAL LOCKOUT - LLO = b"\x11" - - #: UNLISTEN - UNL = b"\x3F" - - # Talker - @staticmethod - def MTA(board_pad) -> bytes: - return int_to_byte(40 + board_pad) - - # Listener - @staticmethod - def MLA(device_pad) -> bytes: - return int_to_byte(20 + device_pad) - - # Listener secondary address - # for VISA SAD range from 1 to 31 and 0 is not SAD - @staticmethod - def MSA(device_sad) -> bytes: - if device_sad == 0: - return b"" - return int_to_byte(95 + device_sad) - - def _find_boards() -> Iterator[Tuple[int, int]]: """Find GPIB board addresses.""" for board in range(16): From e35e81e353eef2d50bf3aeaee256642959607818 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Mon, 18 Dec 2023 18:49:39 +0100 Subject: [PATCH 11/13] appease linters --- pyvisa_py/gpib.py | 2 -- pyvisa_py/protocols/usbtmc.py | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index 11281ecd..4bf4062e 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -8,7 +8,6 @@ """ import ctypes # Used for missing bindings not ideal from bisect import bisect -from enum import Enum from typing import Any, Iterator, List, Tuple, Union from pyvisa import attributes, constants, logger @@ -16,7 +15,6 @@ from pyvisa.rname import GPIBInstr, GPIBIntfc from pyvisa.resources.gpib import GPIBCommand -from .common import int_to_byte from .sessions import Session, UnknownAttribute try: diff --git a/pyvisa_py/protocols/usbtmc.py b/pyvisa_py/protocols/usbtmc.py index f12493ff..65fce744 100644 --- a/pyvisa_py/protocols/usbtmc.py +++ b/pyvisa_py/protocols/usbtmc.py @@ -200,8 +200,9 @@ def __init__( elif len(devices) > 1: desc = "\n".join(str(dev) for dev in devices) raise ValueError( - "{} devices found:\n{}\nPlease narrow the search" - " criteria".format(len(devices), desc) + "{} devices found:\n{}\nPlease narrow the search criteria".format( + len(devices), desc + ) ) self.usb_dev = devices[0] From 3f394bf5b5a8d3ced4601ffd386a9c2b8e9052b4 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Mon, 18 Dec 2023 19:00:05 +0100 Subject: [PATCH 12/13] fix more linter issues --- pyvisa_py/__init__.py | 2 +- pyvisa_py/gpib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyvisa_py/__init__.py b/pyvisa_py/__init__.py index 05202911..2d20fc35 100644 --- a/pyvisa_py/__init__.py +++ b/pyvisa_py/__init__.py @@ -20,7 +20,7 @@ # package is not installed pass -# noqa: we need to import so that __init_subclass__() is executed once +# We need to import so that __init_subclass__() is executed once from . import attributes # noqa: F401 from .highlevel import PyVisaLibrary diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index 4bf4062e..6042ced6 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -12,8 +12,8 @@ from pyvisa import attributes, constants, logger from pyvisa.constants import ResourceAttribute, StatusCode -from pyvisa.rname import GPIBInstr, GPIBIntfc from pyvisa.resources.gpib import GPIBCommand +from pyvisa.rname import GPIBInstr, GPIBIntfc from .sessions import Session, UnknownAttribute From 8b493886f6d9dc444d4dc6768894a358d25613c2 Mon Sep 17 00:00:00 2001 From: MatthieuDartiailh Date: Mon, 18 Dec 2023 19:03:16 +0100 Subject: [PATCH 13/13] fix mypy complaint about static methods --- pyvisa_py/gpib.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyvisa_py/gpib.py b/pyvisa_py/gpib.py index 6042ced6..d3e08a30 100644 --- a/pyvisa_py/gpib.py +++ b/pyvisa_py/gpib.py @@ -493,10 +493,10 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: else 0 ) self.controller.command( - GPIBCommand.MTA(board_pad) + GPIBCommand.MTA(board_pad) # type: ignore + GPIBCommand.UNL - + GPIBCommand.MLA(device_pad) - + GPIBCommand.MSA(device_sad) + + GPIBCommand.MLA(device_pad) # type: ignore + + GPIBCommand.MSA(device_sad) # type: ignore + GPIBCommand.LLO ) elif mode in ( @@ -517,8 +517,8 @@ def gpib_control_ren(self, mode: constants.RENLineOperation) -> StatusCode: ) self.controller.command( GPIBCommand.UNL - + GPIBCommand.MLA(device_pad) - + GPIBCommand.MSA(device_sad) + + GPIBCommand.MLA(device_pad) # type: ignore + + GPIBCommand.MSA(device_sad) # type: ignore ) except gpib.GpibError as e: return convert_gpib_error(e, self.interface.ibsta(), "perform control REN")