Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1126

X-series
Hide thumbs Also See for InfiniiVision 3000:
Table of Contents

Advertisement

39
Programming Examples
# Use auto-scale to automatically set up oscilloscope.
print "Autoscale."
do_command(":AUToscale")
# Set trigger mode.
do_command(":TRIGger:MODE EDGE")
qresult = do_query_string(":TRIGger:MODE?")
print "Trigger mode: %s" % qresult
# Set EDGE trigger parameters.
do_command(":TRIGger:EDGE:SOURCe CHANnel1")
qresult = do_query_string(":TRIGger:EDGE:SOURce?")
print "Trigger edge source: %s" % qresult
do_command(":TRIGger:EDGE:LEVel 1.5")
qresult = do_query_string(":TRIGger:EDGE:LEVel?")
print "Trigger edge level: %s" % qresult
do_command(":TRIGger:EDGE:SLOPe POSitive")
qresult = do_query_string(":TRIGger:EDGE:SLOPe?")
print "Trigger edge slope: %s" % qresult
# Save oscilloscope setup.
setup_bytes = do_query_ieee_block_UI1(":SYSTem:SETup?")
nLength = len(setup_bytes)
fStream = File.Open("setup.stp", FileMode.Create)
fStream.Write(setup_bytes, 0, nLength)
fStream.Close()
print "Setup bytes saved: %d" % nLength
# Change oscilloscope settings with individual commands:
# Set vertical scale and offset.
do_command(":CHANnel1:SCALe 0.05")
qresult = do_query_number(":CHANnel1:SCALe?")
print "Channel 1 vertical scale: %f" % qresult
do_command(":CHANnel1:OFFSet -1.5")
qresult = do_query_number(":CHANnel1:OFFSet?")
print "Channel 1 offset: %f" % qresult
# Set horizontal scale and offset.
do_command(":TIMebase:SCALe 0.0002")
qresult = do_query_string(":TIMebase:SCALe?")
print "Timebase scale: %s" % qresult
do_command(":TIMebase:POSition 0.0")
qresult = do_query_string(":TIMebase:POSition?")
print "Timebase position: %s" % qresult
# Set the acquisition type.
do_command(":ACQuire:TYPE NORMal")
qresult = do_query_string(":ACQuire:TYPE?")
print "Acquire type: %s" % qresult
# Or, set up oscilloscope by loading a previously saved setup.
setup_bytes = File.ReadAllBytes("setup.stp")
1126
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide

Advertisement

Table of Contents
loading

Table of Contents