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
784d98df
Commit
784d98df
authored
Apr 26, 2018
by
Tammo Jan Dijkema
Browse files
Try to make more thread safe, unset event after consuming
parent
4895a0d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
hpib.py
View file @
784d98df
...
...
@@ -78,13 +78,14 @@ class PrologixGpibUsb(PortDevice):
self
.
_serialPort
.
write
(
commandString
)
def
_initialize_prologix_gpi
(
self
):
self
.
_write_serial
(
"++savecfg 0"
+
chr
(
10
))
self
.
_write_serial
(
"++auto 0"
+
chr
(
10
))
self
.
_write_serial
(
"++eoi 1"
+
chr
(
10
))
self
.
_write_serial
(
"++eos 2"
+
chr
(
10
))
self
.
_write_serial
(
"++eot_enable 0"
+
chr
(
10
))
self
.
_write_serial
(
"++eot_char 0"
+
chr
(
10
))
self
.
_write_serial
(
"++read_tmo_ms 500"
+
chr
(
10
))
with
self
.
_lock
:
self
.
_write_serial
(
"++savecfg 0"
+
chr
(
10
))
self
.
_write_serial
(
"++auto 0"
+
chr
(
10
))
self
.
_write_serial
(
"++eoi 1"
+
chr
(
10
))
self
.
_write_serial
(
"++eos 2"
+
chr
(
10
))
self
.
_write_serial
(
"++eot_enable 0"
+
chr
(
10
))
self
.
_write_serial
(
"++eot_char 0"
+
chr
(
10
))
self
.
_write_serial
(
"++read_tmo_ms 500"
+
chr
(
10
))
def
_find_devices
(
self
):
self
.
_devices
=
[]
...
...
@@ -92,8 +93,9 @@ class PrologixGpibUsb(PortDevice):
commandStr
=
"++addr "
+
str
(
address
)
+
chr
(
10
)
+
\
"*idn?"
+
chr
(
10
)
+
\
"++read"
+
chr
(
10
)
self
.
_write_serial
(
commandStr
)
returnStr
=
self
.
_serialPort
.
readline
()
with
self
.
_lock
:
self
.
_write_serial
(
commandStr
)
returnStr
=
self
.
_serialPort
.
readline
()
if
returnStr
!=
""
:
self
.
_devices
+=
[
address
,
returnStr
]
...
...
track_doppler.py
View file @
784d98df
...
...
@@ -41,7 +41,7 @@ def track_doppler(dt, lo,
tracking_frequency
=
freq_hi
,
doppler_function
=
doppler_frequency
,
exit_event
=
None
,
timeout
=
0.
5
):
timeout
=
0.
3
):
"""Sets the Local Oscillator to a frequency to correct for Doppler shift. When exit event is
set, return the LO frequency to 1GHz.
...
...
@@ -69,3 +69,4 @@ def track_doppler(dt, lo,
lo
.
frequency
=
dfreq
exit_event
.
wait
(
timeout
=
timeout
)
lo
.
frequency
=
1
*
u
.
GHz
exit_event
.
unset
()
Write
Preview
Markdown
is supported
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