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
auke.klazema
HPIB
Commits
5cc34ee9
Commit
5cc34ee9
authored
Feb 16, 2018
by
auke.klazema
Browse files
extracted device initialisation to a method
parent
35e34df8
Changes
1
Show whitespace changes
Inline
Side-by-side
hpib.py
View file @
5cc34ee9
...
...
@@ -32,13 +32,8 @@ class PrologixGpibUsb(PortDevice):
self
.
_find_available_port
(
maxDeviceNum
,
port
,
portFormat
,
timeout
,
verbose
)
self
.
_serialPort
.
write
(
"++savecfg 0"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++auto 0"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++eoi 1"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++eos 2"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++eot_enable 0"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++eot_char 0"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++read_tmo_ms 500"
+
chr
(
10
))
self
.
_initialize_prologix_gpi
()
if
findDevices
:
self
.
_devices
=
[]
for
self
.
_hpib_address
in
range
(
0
,
31
):
...
...
@@ -53,6 +48,15 @@ class PrologixGpibUsb(PortDevice):
self
.
_devices
=
"Not scanned."
self
.
_hpib_address
=
-
1
def
_initialize_prologix_gpi
(
self
):
self
.
_serialPort
.
write
(
"++savecfg 0"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++auto 0"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++eoi 1"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++eos 2"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++eot_enable 0"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++eot_char 0"
+
chr
(
10
))
self
.
_serialPort
.
write
(
"++read_tmo_ms 500"
+
chr
(
10
))
def
_find_available_port
(
self
,
maxDeviceNum
,
port
,
portFormat
,
timeout
,
verbose
):
while
int
(
self
.
_rematch
.
group
(
2
))
<
maxDeviceNum
:
if
verbose
:
...
...
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