Technical data

Table Of Contents
1302 Agilent Infiniium 9000 Series Oscilloscopes Programmer's Reference
38 Sample Programs
print "Acquire mode: %s" % acq_mode_dict[int(acq_mode)]
print "Completion pct: %s" % completion
print "Waveform X units: %s" % units_dict[int(x_units)]
print "Waveform Y units: %s" % units_dict[int(y_units)]
print "Max BW limit: %s" % max_bw_limit
print "Min BW limit: %s" % min_bw_limit
# Get numeric values for later calculations.
x_increment = scope.SCPI.WAVeform.XINCrement.Query()
x_origin = scope.SCPI.WAVeform.XORigin.Query()
y_increment = scope.SCPI.WAVeform.YINCrement.Query()
y_origin = scope.SCPI.WAVeform.YORigin.Query()
# Get the waveform data.
scope.SCPI.WAVeform.STReaming.Command(False)
data_words = scope.SCPI.WAVeform.DATA.QueryWord(None, None)
nLength = len(data_words)
print "Number of data values: %d" % nLength
# Open file for output.
strPath = "waveform_data.csv"
writer = File.CreateText(strPath)
# Output waveform data in CSV format.
for i in xrange(0, nLength - 1):
time_val = x_origin+i*x_increment
voltage = data_words[i] * y_increment + y_origin
writer.WriteLine("%E, %f" % (time_val, voltage))
# Close output file.
writer.Close()
print "Waveform format WORD data written to %s." % strPath
# =========================================================
# Main program:
# =========================================================
#addr = "agilent-d9c8a49.cos.agilent.com"
addr = "TCPIP0::agilent-d9c8a49.cos.agilent.com::inst0::INSTR"
scope = Ag9000A(addr)
scope.Transport.DefaultTimeout.Set(10000)
# Initialize the oscilloscope, capture data, and analyze.
initialize()
capture()
analyze()
print "End of program."
# Wait for a key press before exiting.
print "Press any key to exit..."
Console.ReadKey(True)