Commit 4895a0d1 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Remove cache of hpib_address

parent 40e456b0
...@@ -19,7 +19,6 @@ class PortDevice(object): ...@@ -19,7 +19,6 @@ class PortDevice(object):
class PrologixGpibUsb(PortDevice): class PrologixGpibUsb(PortDevice):
_serialPort = None _serialPort = None
_hpib_address = -1
_devices = "Not scanned." _devices = "Not scanned."
def __init__(self, port="", timeout=1, port_format="%d", max_device_num=9, verbose=False, def __init__(self, port="", timeout=1, port_format="%d", max_device_num=9, verbose=False,
...@@ -99,17 +98,13 @@ class PrologixGpibUsb(PortDevice): ...@@ -99,17 +98,13 @@ class PrologixGpibUsb(PortDevice):
self._devices += [address, returnStr] self._devices += [address, returnStr]
def command(self, hpib_address, command): def command(self, hpib_address, command):
if hpib_address != self._hpib_address: command = "++addr " + str(hpib_address) + chr(10) + command
command = "++addr " + str(hpib_address) + chr(10) + command
self._hpib_address = hpib_address
with self._lock: with self._lock:
self._write_serial(command + chr(10)) self._write_serial(command + chr(10))
def query(self, hpib_address, query, count=80): def query(self, hpib_address, query, count=80):
if hpib_address != self._hpib_address: query = "++addr " + str(hpib_address) + chr(10) + query
query = "++addr " + str(hpib_address) + chr(10) + query
self._hpib_address = hpib_address
query += chr(10) + "++read eoi" + chr(10) query += chr(10) + "++read eoi" + chr(10)
with self._lock: with self._lock:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment