Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking
Commits
580b25d4
Commit
580b25d4
authored
Feb 02, 2017
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pulse_gen.py: block execution until the pulse burst is completed
parent
389c01b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
pulse_gen.py
software/utils/pulse_gen.py
+15
-12
No files found.
software/utils/pulse_gen.py
View file @
580b25d4
...
...
@@ -134,16 +134,7 @@ ser.write(b'OUTP OFF\r\n')
ser
.
write
(
b
'*RST
\r\n
'
)
# clear errors
while
True
:
ser
.
write
(
b
'SYST:ERR?
\r\n
'
)
status
=
ser
.
readline
()
.
decode
()
if
status
==
''
:
print
(
'ERROR: Could not read the error queue'
)
sys
.
exit
(
2
)
if
status
.
startswith
(
'+0'
):
break
ser
.
write
(
b
'*CLS
\r\n
'
)
###############################################################################
# Select the way of generating pulses
...
...
@@ -257,8 +248,20 @@ ser.write(b'OUTP ON\r\n')
# trigger the output
ser
.
write
(
b
'*TRG
\r\n
'
)
ser
.
write
(
b
'*WAI
\r\n
'
)
# wait for the operation to complete
ser
.
write
(
b
'*OPC?
\r\n
'
)
while
True
:
status
=
ser
.
readline
()
.
decode
()
if
len
(
status
)
>
0
:
if
not
status
.
startswith
(
'1'
):
error
=
True
print
(
'ERROR: Operation interrupted (status:
%
s)'
%
status
)
break
ser
.
write
(
b
'OUTP OFF
\r\n
'
)
ser
.
close
()
print
(
'Finished successfully'
)
if
not
error
:
print
(
'Finished successfully'
)
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