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
ec576b5f
Commit
ec576b5f
authored
7 years ago
by
Niklas Borchers
Browse files
Options
Downloads
Plain Diff
Merge branch 'AgilentVNA' into 'master'
Agilent Vector Analyzer See merge request
!1
parents
770e9759
42bb73b3
Branches
Branches containing commit
No related tags found
1 merge request
!1
Agilent Vector Analyzer
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Agilent_NetworkAnalyzer/Agilent_NetworkAnalyzer.ini
+1
-1
1 addition, 1 deletion
Agilent_NetworkAnalyzer/Agilent_NetworkAnalyzer.ini
Agilent_NetworkAnalyzer/Agilent_NetworkAnalyzer.py
+18
-15
18 additions, 15 deletions
Agilent_NetworkAnalyzer/Agilent_NetworkAnalyzer.py
with
19 additions
and
16 deletions
Agilent_NetworkAnalyzer/Agilent_NetworkAnalyzer.ini
+
1
−
1
View file @
ec576b5f
...
...
@@ -6,7 +6,7 @@
name:
Agilent
Network
Analyzer
# The version string should be updated whenever changes are made to this config file
version:
1.0
version:
1.
1.0
# Name of folder containing the code defining a custom driver. Do not define this item
# or leave it blank for any standard driver based on the built-in VISA interface.
...
...
This diff is collapsed.
Click to expand it.
Agilent_NetworkAnalyzer/Agilent_NetworkAnalyzer.py
+
18
−
15
View file @
ec576b5f
...
...
@@ -2,8 +2,9 @@
from
VISA_Driver
import
VISA_Driver
import
numpy
as
np
import
time
__version__
=
"
0.
0.1
"
__version__
=
"
0.
1.0
"
class
Error
(
Exception
):
pass
...
...
@@ -104,30 +105,31 @@ class Driver(VISA_Driver):
# if not in continous mode, trig from computer
bWaitTrace
=
self
.
getValue
(
'
Wait for new trace
'
)
bAverage
=
self
.
getValue
(
'
Average
'
)
duration
=
(
float
(
self
.
askAndLog
(
"
SENS:SWE:TIME?
"
))
*
(
self
.
getValue
(
'
# of averages
'
)
if
bAverage
else
1
))
# wait for trace, either in averaging or normal mode
if
bWaitTrace
:
self
.
writeAndLog
(
'
:ABOR;:TRIG:SOUR BUS;:INIT:CONT OFF;:INIT:IMM;
'
)
if
bAverage
:
# set channels 1-4 to set event when average complete (bit 1 start)
self
.
writeAndLog
(
'
:SENS:AVER:CLE;:STAT:OPER:AVER1:ENAB 30;:ABOR;:SENS:AVER:CLE;
'
)
else
:
self
.
writeAndLog
(
'
:ABOR;:INIT:CONT OFF;:INIT:IMM;
'
)
self
.
writeAndLog
(
'
:TRIG:AVER ON
'
)
self
.
writeAndLog
(
'
:TRIG:SING;
'
)
self
.
writeAndLog
(
'
*OPC
'
)
# wait some time before first check
self
.
wait
(
0.03
)
bDone
=
False
start_time
=
time
.
time
()
while
(
not
bDone
)
and
(
not
self
.
isStopped
()):
# check if done
if
bAverage
:
sAverage
=
self
.
askAndLog
(
'
STAT:OPER:AVER1:COND?
'
)
bDone
=
int
(
sAverage
)
>
0
else
:
stb
=
int
(
self
.
askAndLog
(
'
*ESR?
'
))
bDone
=
(
stb
&
1
)
>
0
if
not
bDone
:
#report progress
self
.
reportProgress
((
time
.
time
()
-
start_time
)
/
duration
)
self
.
wait
(
0.1
)
# if stopped, don't get data
if
self
.
isStopped
():
self
.
writeAndLog
(
'
*CLS;:
INIT:CONT ON
;
'
)
self
.
writeAndLog
(
'
*CLS;:
TRIG:SOUR INT;:TRIG:AVER OFF;:ABOR
;
'
)
return
[]
# get data as float32, convert to numpy array
if
self
.
getModel
()
in
(
'
E5071C
'
,):
...
...
@@ -137,8 +139,9 @@ class Driver(VISA_Driver):
# old parameter handing
self
.
write
(
'
:FORM REAL,32;CALC:DATA? SDATA
'
,
bCheckError
=
False
)
sData
=
self
.
read
(
ignore_termination
=
True
)
if
bWaitTrace
and
not
bAverage
:
self
.
writeAndLog
(
'
:INIT:CONT ON;
'
)
if
bWaitTrace
:
self
.
writeAndLog
(
'
:TRIG:SOUR INT;:TRIG:AVER OFF;:ABOR;
'
)
# strip header to find # of points
i0
=
sData
.
find
(
b
'
#
'
)
nDig
=
int
(
sData
[
i0
+
1
:
i0
+
2
])
...
...
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