Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
HPIB
Commits
4895a0d1
Commit
4895a0d1
authored
Apr 26, 2018
by
Tammo Jan Dijkema
Browse files
Remove cache of hpib_address
parent
40e456b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
hpib.py
View file @
4895a0d1
...
...
@@ -19,7 +19,6 @@ class PortDevice(object):
class
PrologixGpibUsb
(
PortDevice
):
_serialPort
=
None
_hpib_address
=
-
1
_devices
=
"Not scanned."
def
__init__
(
self
,
port
=
""
,
timeout
=
1
,
port_format
=
"%d"
,
max_device_num
=
9
,
verbose
=
False
,
...
...
@@ -99,17 +98,13 @@ class PrologixGpibUsb(PortDevice):
self
.
_devices
+=
[
address
,
returnStr
]
def
command
(
self
,
hpib_address
,
command
):
if
hpib_address
!=
self
.
_hpib_address
:
command
=
"++addr "
+
str
(
hpib_address
)
+
chr
(
10
)
+
command
self
.
_hpib_address
=
hpib_address
command
=
"++addr "
+
str
(
hpib_address
)
+
chr
(
10
)
+
command
with
self
.
_lock
:
self
.
_write_serial
(
command
+
chr
(
10
))
def
query
(
self
,
hpib_address
,
query
,
count
=
80
):
if
hpib_address
!=
self
.
_hpib_address
:
query
=
"++addr "
+
str
(
hpib_address
)
+
chr
(
10
)
+
query
self
.
_hpib_address
=
hpib_address
query
=
"++addr "
+
str
(
hpib_address
)
+
chr
(
10
)
+
query
query
+=
chr
(
10
)
+
"++read eoi"
+
chr
(
10
)
with
self
.
_lock
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment