Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
qutech
python-TaborDriver
Commits
7a6344a3
Commit
7a6344a3
authored
Feb 19, 2020
by
Simon Sebastian Humpohl
Browse files
Add an empty read after each send_cmd if a simulator was detected.
parent
05a2144b
Changes
2
Hide whitespace changes
Inline
Side-by-side
pytabor/pytabor16.py
View file @
7a6344a3
...
...
@@ -38,7 +38,7 @@ import numpy as np
from
pyvisa
import
ResourceManager
import
pyvisa.constants
as
vc
__version__
=
'1.0.
1
'
__version__
=
'1.0.
2
'
__revision__
=
'$Rev: 4238 $'
__docformat__
=
'reStructuredText'
...
...
teawg/__init__.py
View file @
7a6344a3
...
...
@@ -356,6 +356,8 @@ class TEWXAwg(object):
if
self
.
_instr_addr
is
not
None
:
self
.
open
()
self
.
_simulator_read_workaround
=
self
.
is_simulator
def
__enter__
(
self
):
return
self
...
...
@@ -474,6 +476,11 @@ class TEWXAwg(object):
paranoia_level
=
self
.
_paranoia_level
pytabor
.
send_cmd
(
self
.
_visa_inst
,
cmd_str
,
paranoia_level
)
if
self
.
_simulator_read_workaround
and
paranoia_level
==
0
:
empty_str
=
self
.
_visa_inst
.
read
()
assert
empty_str
==
''
,
(
"This workaround expects an empty response after each command that is not a query."
" The simulator does this in some versions. It is controlled by the attribute "
"_simulator_read_workaround. Actual response was: %r"
%
empty_str
)
def
send_query
(
self
,
query_str
):
'''Send the given query to the instrument and read the response
...
...
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