Agilent Technologies InfiniiVision 2000 X-Series Programmer's Manual page 915

Oscilloscopes
Hide thumbs Also See for InfiniiVision 2000 X-Series:
Table of Contents

Advertisement

# =========================================================
def analyze():
# Make measurements.
# --------------------------------------------------------
scope.SCPI.MEASure.SOURce.Command("CHANnel1", None)
(source1, source2) = scope.SCPI.MEASure.SOURce.Query()
print "Measure source: %s" % source1
scope.SCPI.MEASure.FREQuency.Command("CHANnel1")
qresult = scope.SCPI.MEASure.FREQuency.Query("CHANnel1")
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.
# --------------------------------------------------------
scope.SCPI.HARDcopy.INKSaver.Command(False)
image_bytes = scope.SCPI.DISPlay.DATA.Query("PNG", "COLor")
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.
# --------------------------------------------------------
# Set the waveform points mode.
scope.SCPI.WAVeform.POINts.MODE.Command("RAW")
qresult = scope.SCPI.WAVeform.POINts.MODE.Query()
print "Waveform points mode: %s" % qresult
# Get the number of waveform points available.
scope.SCPI.WAVeform.POINts.CommandPoints(10240)
qresult = scope.SCPI.WAVeform.POINts.Query1()
print "Waveform points available: %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("BYTE")
qresult = scope.SCPI.WAVeform.FORMat.Query()
print "Waveform format: %s" % qresult
# Display the waveform settings from preamble:
wav_form_dict = {
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
0 : "BYTE",
1 : "WORD",
4 : "ASCii",
Programming Examples
915
38

Advertisement

Table of Contents
loading

Table of Contents