Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drivers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Labber-I2A
Drivers
Commits
770e9759
Commit
770e9759
authored
7 years ago
by
Simon - PXI
Browse files
Options
Downloads
Patches
Plain Diff
Tabor AWG: wait for ready before turning on output
parent
4f316f4d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tabor_SE5082_AWG/Tabor_SE5082_AWG.ini
+4
-0
4 additions, 0 deletions
Tabor_SE5082_AWG/Tabor_SE5082_AWG.ini
Tabor_SE5082_AWG/Tabor_SE5082_AWG.py
+26
-5
26 additions, 5 deletions
Tabor_SE5082_AWG/Tabor_SE5082_AWG.py
with
30 additions
and
5 deletions
Tabor_SE5082_AWG/Tabor_SE5082_AWG.ini
+
4
−
0
View file @
770e9759
...
...
@@ -41,6 +41,10 @@ timeout = 1.0
# If False, the driver will not perform any operations (unless there is a custom driver).
use_visa
=
True
tcpip_specify_port:
True
tcpip_port:
5025
term_char:
LF
# Define quantities in sections. This list is a selection of allowed keywords,
# see the manual for a full list of options
...
...
This diff is collapsed.
Click to expand it.
Tabor_SE5082_AWG/Tabor_SE5082_AWG.py
+
26
−
5
View file @
770e9759
#!/usr/bin/env python
from
BaseDriver
import
Error
,
IdError
from
BaseDriver
import
Error
from
VISA_Driver
import
VISA_Driver
from
pyvisa.constants
import
(
VI_ATTR_WR_BUF_OPER_MODE
,
VI_ATTR_RD_BUF_OPER_MODE
,
VI_FLUSH_ON_ACCESS
,
VI_READ_BUF
,
VI_WRITE_BUF
)
import
numpy
as
np
import
os
from
pyte16
import
download_binary_data
...
...
@@ -13,6 +15,24 @@ class Driver(VISA_Driver):
"""
Perform the operation of opening the instrument connection
"""
# open visa communication
VISA_Driver
.
performOpen
(
self
,
options
)
# set additional flags
self
.
com
.
set_visa_attribute
(
VI_ATTR_WR_BUF_OPER_MODE
,
VI_FLUSH_ON_ACCESS
)
self
.
com
.
set_visa_attribute
(
VI_ATTR_RD_BUF_OPER_MODE
,
VI_FLUSH_ON_ACCESS
)
read_buff_size_bytes
=
4096
write_buff_size_bytes
=
4096
self
.
com
.
visalib
.
set_buffer
(
self
.
com
.
session
,
VI_READ_BUF
,
read_buff_size_bytes
)
self
.
com
.
__dict__
[
'
read_buff_size
'
]
=
read_buff_size_bytes
self
.
com
.
visalib
.
set_buffer
(
self
.
com
.
session
,
VI_WRITE_BUF
,
write_buff_size_bytes
)
self
.
com
.
__dict__
[
'
write_buff_size
'
]
=
write_buff_size_bytes
# timeout
self
.
timeout_ms
=
int
(
1000
*
self
.
dComCfg
[
'
Timeout
'
])
self
.
nCh
=
2
...
...
@@ -125,8 +145,8 @@ class Driver(VISA_Driver):
sOutput
+=
(
'
:INST %d;:OUTP 1;
'
%
(
n
+
1
))
if
sOutput
!=
''
:
self
.
writeAndLog
(
sOutput
)
#
wait some time to allow output to
turn
on
self
.
wait
(
0.02
)
#
check for operation complete before re
turn
ing
self
.
askAndLog
(
'
*OPC?
'
)
def
scaleWaveformToU16
(
self
,
vData
,
dVpp
,
ch
):
...
...
@@ -186,7 +206,8 @@ class Driver(VISA_Driver):
self
.
writeAndLog
(
'
:TRAC:DEF 1, %d
'
%
len
(
vU16
))
self
.
writeAndLog
(
'
:TRAC:SEL 1
'
)
download_binary_data
(
self
.
com
,
'
TRAC:DATA
'
,
vU16
,
len
(
vU16
)
*
2
)
download_binary_data
(
self
.
com
,
'
TRAC:DATA
'
,
vU16
,
len
(
vU16
)
*
2
,
paranoia_level
=
0
)
return
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment