Agilent Technologies Infiniium 90000 Series Programmer's Manual page 1146

Oscilloscopes
Hide thumbs Also See for Infiniium 90000 Series:
Table of Contents

Advertisement

38
Sample Programs
# 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 mode.
scope.SCPI.ACQuire.MODE.Command("RTIMe")
qresult = scope.SCPI.ACQuire.MODE.Query()
print "Acquire mode: %s" % qresult
# Or, set up oscilloscope by loading a previously saved setup.
setup_lines = File.ReadAllBytes("setup.stp")
scope.SCPI.SYSTem.SETup.Command(setup_lines)
print "Setup lines restored: %d" % len(setup_lines)
# Set the desired number of waveform points,
# and capture an acquisition.
scope.SCPI.ACQuire.POINts.Command(32000)
scope.SCPI.DIGitize.Command(None)
# =========================================================
# Analyze:
# =========================================================
def analyze():
# Make measurements.
# --------------------------------------------------------
scope.SCPI.MEASure.SOURce.Command("CHANnel1", None)
source_list = scope.SCPI.MEASure.SOURce.Queryx()
print "Measure source: %s" % source_list[0]
scope.SCPI.MEASure.FREQuency.Command("CHANnel1", None)
qresult = scope.SCPI.MEASure.FREQuency.QuerySendValidOff("CHANnel1", No
ne)
print "Measured frequency on channel 1: %f" % qresult
# Use direct command/query when commands not in command set.
scope.Transport.Command.Invoke(":MEASure:VAMPlitude CHANnel1")
qresult = scope.Transport.Query.Invoke(":MEASure:VAMPlitude? CHANnel1")
print "Measured vertical amplitude on channel 1: %s" % qresult
# Download the screen image.
# --------------------------------------------------------
image_bytes = scope.SCPI.DISPlay.DATA.Query("PNG", None, None, None)
nLength = len(image_bytes)
fStream = File.Open("screen_image.png", FileMode.Create)
fStream.Write(image_bytes, 0, nLength)
fStream.Close()
print "Screen image written to screen_image.png."
# Download waveform data.
1146
Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents