Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
wr-calibration
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
white-rabbit
wr-calibration
Commits
949a6042
Commit
949a6042
authored
Sep 26, 2016
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added osc_init
parent
87a5b4db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
11 deletions
+55
-11
LeCroy8254.py
sw/ab_cal_scripts/lib/LeCroy8254.py
+55
-11
No files found.
sw/ab_cal_scripts/lib/LeCroy8254.py
View file @
949a6042
...
...
@@ -8,7 +8,7 @@ Usage:
LeCroy8254.py -h | --help
IP IP number of the Oscilloscope
(for example: 192.168.32.24
8
which is its DevNet IP number)
(for example: 192.168.32.24
3
which is its DevNet IP number)
Options:
-h --help Show this screen.
...
...
@@ -600,6 +600,56 @@ def file_to_waveform(filename):
data_file
.
close
()
return
waveform_data
############################################################################
def
osc_init
(
scope
,
time_base
=
50.0e-9
):
"""
Initialize the Oscilloscope for the timestamp edge to SFD measurement.
scope -- instance of python-vxi connected to the oscilloscope
time_base -- <float> time base, default 50 ns/div
"""
#scope = vxi11.Instrument("192.168.32.243")
print
(
scope
.
ask
(
"*IDN?"
))
# Returns '*IDN LECROY,HDO4034-MS,LCRY-HDO,7.9.0'
# Use Channel 1 pulse input
# use Channel 3 Ethernet Frame input
# A fixed trigger level is important for proper timing measurement
# Choose 1.4 Volt for a direct signal but 0.8 Volt when the signal
# is split by a power splitter
scope
.
write
(
"TRIG_SELECT EDGE,SR,C1"
)
use_power_splitter
=
True
if
use_power_splitter
:
scope
.
write
(
"C1:TRIG_LEVEL 0.4"
)
scope
.
write
(
"C1:Volt_DIV 0.5"
)
else
:
scope
.
write
(
"C1:TRIG_LEVEL 0.7"
)
scope
.
write
(
"C1:Volt_DIV 0.75"
)
scope
.
write
(
"C1:COUPLING D50"
)
scope
.
write
(
"C1:OFFSET 0.0"
)
scope
.
write
(
"C3:COUPLING D50"
)
scope
.
write
(
"C3:OFFSET 0.0"
)
scope
.
write
(
"C3:Volt_DIV 0.125"
)
scope
.
write
(
"C4:COUPLING D50"
)
scope
.
write
(
"C4:OFFSET 0.0"
)
scope
.
write
(
"C4:Volt_DIV 0.125"
)
# Trigger in the centre of the screen; important for maximum estimations
# forwarded to function average_edge_to_sfd
scope
.
write
(
"TRIG_DELAY 0 ns"
)
scope
.
write
(
"TIME_DIV "
+
str
(
time_base
))
# set 50 ns/div
#scope.write("REFERENCE_CLOCK EXTERNAL") # set external refrence clock
return
############################################################################
##
## If run from commandline, we can test the library
...
...
@@ -608,13 +658,9 @@ if __name__ == "__main__":
arguments
=
docopt
(
__doc__
,
version
=
'LeCroy WaveRunner 8254M-MS version 01'
)
print
(
"aap"
,
arguments
)
#print(len(sys.argv))
#print(sys.argv)
if
len
(
sys
.
argv
)
>=
2
:
# just IP number
scope
=
vxi11
.
Instrument
(
sys
.
argv
[
1
])
#scope = vxi11.Instrument("192.168.32.24
8
")
#scope = vxi11.Instrument("192.168.32.24
3
")
print
(
scope
.
ask
(
"*IDN?"
))
# Returns '*IDN LECROY,HDO4034-MS,LCRY-HDO,7.9.0'
channels
=
'1'
...
...
@@ -624,7 +670,6 @@ if __name__ == "__main__":
if
len
(
sys
.
argv
)
>=
3
:
# There are more arguments...
for
i
in
range
(
1
,
len
(
sys
.
argv
)):
option
=
sys
.
argv
[
i
]
.
split
(
'='
)
print
(
option
)
if
option
[
0
]
==
'-c'
:
# set channels
channels
=
option
[
1
]
#print("channels:",channels)
...
...
@@ -634,14 +679,13 @@ if __name__ == "__main__":
if
option
[
0
]
==
'-a'
:
# set number of averages
num_avg
=
int
(
option
[
1
])
print
(
"channels:"
,
channels
,
"num_avg"
,
num_avg
)
#print ("channels:",channels, "num_avg", num_avg)
# Use Channel 1 pulse input
# use Channel 3 Ethernet Frame input
# A fixed trigger level (1,4 Volt) is important for proper timing measurement
#
scope.write("C1:TRIG_LEVEL 1.4")
scope
.
write
(
"C1:TRIG_LEVEL 1.4"
)
scope
.
write
(
"C1:COUPLING DC50"
)
# Trigger in the centre of the screen; important for maximum estimations
...
...
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