Agilent Technologies InfiniiVision 3000 X-Series Programmer's Manual page 1177

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

Advertisement

# =========================================================
# Analyze:
# =========================================================
def analyze():
# Make measurements.
# --------------------------------------------------------
do_command(":MEASure:SOURce CHANnel1")
qresult = do_query_string(":MEASure:SOURce?")
print "Measure source: %s" % qresult
do_command(":MEASure:FREQuency")
qresult = do_query_string(":MEASure:FREQuency?")
print "Measured frequency on channel 1: %s" % qresult
do_command(":MEASure:VAMPlitude")
qresult = do_query_string(":MEASure:VAMPlitude?")
print "Measured vertical amplitude on channel 1: %s" % qresult
# Download the screen image.
# --------------------------------------------------------
do_command(":HARDcopy:INKSaver OFF")
image_bytes = do_query_ieee_block(":DISPlay:DATA? PNG, COLor")
nLength = len(image_bytes)
f = open("c:\scope\data\screen.bmp", "wb")
f.write(bytearray(image_bytes))
f.close()
print "Screen image written to c:\scope\data\screen.bmp."
# Download waveform data.
# --------------------------------------------------------
# Set the waveform points mode.
do_command(":WAVeform:POINts:MODE RAW")
qresult = do_query_string(":WAVeform:POINts:MODE?")
print "Waveform points mode: %s" % qresult
# Get the number of waveform points available.
do_command(":WAVeform:POINts 10240")
qresult = do_query_string(":WAVeform:POINts?")
print "Waveform points available: %s" % qresult
# Set the waveform source.
do_command(":WAVeform:SOURce CHANnel1")
qresult = do_query_string(":WAVeform:SOURce?")
print "Waveform source: %s" % qresult
# Choose the format of the data returned:
do_command(":WAVeform:FORMat BYTE")
print "Waveform format: %s" % do_query_string(":WAVeform:FORMat?")
# Display the waveform settings from preamble:
wav_form_dict = {
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
0 : "BYTE",
1 : "WORD",
Programming Examples
1177
40

Advertisement

Table of Contents
loading

Table of Contents