Technical data

Table Of Contents
1300 Agilent Infiniium 9000 Series Oscilloscopes Programmer's Reference
38 Sample Programs
# Make measurements.
# --------------------------------------------------------
scope.SCPI.MEASure.SOURce.Command("CHANnel1", None)
source_list = scope.SCPI.MEASure.SOURce.Query()
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.
# --------------------------------------------------------
# Get the waveform points mode.
qresult = scope.SCPI.WAVeform.TYPE.Query()
print "Waveform points mode: %s" % qresult
# Get the number of waveform points.
qresult = scope.SCPI.WAVeform.POINts.Query()
print "Waveform points: %s" % qresult
# Set the waveform source.
scope.SCPI.WAVeform.SOURce.Command("CHANnel1")
qresult = scope.SCPI.WAVeform.SOURce.Query()
print "Waveform source: %s" % qresult
# Choose the format of the data returned:
scope.SCPI.WAVeform.FORMat.Command("WORD")
qresult = scope.SCPI.WAVeform.FORMat.Query()
print "Waveform format: %s" % qresult
scope.SCPI.WAVeform.BYTeorder.Command("LSBFirst")
qresult = scope.SCPI.WAVeform.BYTeorder.Query()
print "Waveform byte order: %s" % qresult
# Display the waveform settings from preamble:
wav_form_dict = {
0 : "ASCii",
1 : "BYTE",
2 : "WORD",
3 : "LONG",