1332
Agilent InfiniiVision 4000 X-Series Oscilloscopes Programmer's Guide
41
Programming Examples
print "Trigger mode: %s" % qresult
# Set EDGE trigger parameters.
scope.SCPI.TRIGger.EDGE.SOURce.Command("CHANnel1")
qresult = scope.SCPI.TRIGger.EDGE.SOURce.Query()
print "Trigger edge source: %s" % qresult
scope.SCPI.TRIGger.EDGE.LEVel.Command(1.5, "CHANnel1")
qresult = scope.SCPI.TRIGger.EDGE.LEVel.Query("CHANnel1")
print "Trigger edge level: %s" % qresult
scope.SCPI.TRIGger.EDGE.SLOPe.Command("POSitive")
qresult = scope.SCPI.TRIGger.EDGE.SLOPe.Query()
print "Trigger edge slope: %s" % qresult
# Save oscilloscope setup.
setup_lines = scope.SCPI.SYSTem.SETup.Query()
nLength = len(setup_lines)
File.WriteAllLines("setup.stp", setup_lines)
print "Setup lines saved: %d" % nLength
# Change oscilloscope settings with individual commands:
# Set vertical scale and offset.
scope.SCPI.CHANnel.SCALe.Command(1, 0.05)
qresult = scope.SCPI.CHANnel.SCALe.Query(1)
print "Channel 1 vertical scale: %f" % qresult
scope.SCPI.CHANnel.OFFSet.Command(1, -1.5)
qresult = scope.SCPI.CHANnel.OFFSet.Query(1)
print "Channel 1 offset: %f" % qresult
# Set horizontal scale and offset.
scope.SCPI.TIMebase.SCALe.Command(0.0002)
qresult = scope.SCPI.TIMebase.SCALe.Query()
print "Timebase scale: %f" % qresult
scope.SCPI.TIMebase.POSition.Command(0.0)
qresult = scope.SCPI.TIMebase.POSition.Query()
print "Timebase position: %f" % qresult
# Set the acquisition type.
scope.SCPI.ACQuire.TYPE.Command("NORMal")
qresult = scope.SCPI.ACQuire.TYPE.Query()
print "Acquire type: %s" % qresult
# Or, set up oscilloscope by loading a previously saved setup.
setup_lines = File.ReadAllLines("setup.stp")
scope.SCPI.SYSTem.SETup.Command(setup_lines)
print "Setup lines restored: %d" % len(setup_lines)
# Capture an acquisition using :DIGitize.
scope.SCPI.DIGitize.Command("CHANnel1", None, None, None, None)
# =========================================================
# Analyze:
Summary of Contents for InfiniiVision 4000 X-Series
Page 1: ...s1 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 32: ...32 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 52: ...52 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 2 Setting Up ...
Page 66: ...66 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 3 Getting Started ...
Page 242: ...242 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 7 ACQuire Commands ...
Page 252: ...252 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands ...
Page 300: ...300 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 12 DEMO Commands ...
Page 330: ...330 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 15 DVM Commands ...
Page 386: ...386 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 18 HARDcopy Commands ...
Page 484: ...484 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 21 MEASure Commands ...
Page 1098: ...1098 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 34 WGEN w Commands ...
Page 1174: ...1174 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 37 Error Messages ...
Page 1352: ...1352 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide Index ...