1214
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
39
Programming Examples
}
acq_type_dict = {
0 : "NORMal",
1 : "PEAK",
2 : "AVERage",
3 : "HRESolution",
}
(
wav_form, acq_type, wfmpts, avgcnt, x_increment, x_origin,
x_reference, y_increment, y_origin, y_reference
) = scope.SCPI.WAVeform.PREamble.Query()
print "Waveform format: %s" % wav_form_dict[int(wav_form)]
print "Acquire type: %s" % acq_type_dict[int(acq_type)]
print "Waveform points desired: %s" % wfmpts
print "Waveform average count: %s" % avgcnt
print "Waveform X increment: %s" % x_increment
print "Waveform X origin: %s" % x_origin
print "Waveform X reference: %s" % x_reference
# Always 0.
print "Waveform Y increment: %s" % y_increment
print "Waveform Y origin: %s" % y_origin
print "Waveform Y reference: %s" % y_reference
# 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()
y_reference = scope.SCPI.WAVeform.YREFerence.Query()
# Get the waveform data.
data_bytes = scope.SCPI.WAVeform.DATA.QueryBYTE()
nLength = len(data_bytes)
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_ i * x_increment
voltage = (data_bytes[i] - y_reference) * y_inc y_origin
writer.WriteLine("%E, %f" % (time_val, voltage))
# Close output file.
writer.Close()
print "Waveform format BYTE data written to %s." % strPath
# =========================================================
# Main program:
# =========================================================
#addr = "a-mx3054a-60028.cos.agilent.com"
addr = "TCPIP0::a-mx3054a-60028.cos.agilent.com::inst0::INSTR"
scope = AgInfiniiVision3000X(addr)
Summary of Contents for InfiniiVision 3000 X-Series
Page 1: ...s1 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide...
Page 30: ...30 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide...
Page 54: ...54 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 2 Setting Up...
Page 68: ...68 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 3 Getting Started...
Page 218: ...218 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 6 Root Commands...
Page 242: ...242 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands...
Page 280: ...280 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 11 DEMO Commands...
Page 288: ...288 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 12 DIGital d Commands...
Page 340: ...340 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 15 FUNCtion Commands...
Page 358: ...358 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 16 HARDcopy Commands...
Page 378: ...378 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 18 MARKer Commands...
Page 446: ...446 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 19 MEASure Commands...
Page 564: ...564 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 23 POWer Commands...
Page 842: ...842 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 29 TIMebase Commands...
Page 1054: ...1054 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 35 Error Messages...
Page 1076: ...1076 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide 36 Status Reporting...
Page 1232: ...1232 Agilent InfiniiVision 3000 X Series Oscilloscopes Programmer s Guide Index...