Programming Examples
42
Keysight InfiniiVision 3000T X-Series Oscilloscopes Programmer's Guide
1363
y_reference = do_query_values(":WAVeform:YREFerence?")[0]
# Get the waveform data.
sData = do_query_string(":WAVeform:DATA?")
sData = get_definite_length_block_data(sData)
# Unpack unsigned byte data.
values = struct.unpack("%dB" % len(sData), sData)
print "Number of data values: %d" % len(values)
# Save waveform data values to CSV file.
f = open("waveform_data.csv", "w")
for i in xrange(0, len(values) - 1):
time_val = x_ (i * x_increment)
voltage = ((values[i] - y_reference) * y_increment) + y_origin
f.write("%E, %f\n" % (time_val, voltage))
f.close()
print "Waveform format BYTE data written to waveform_data.csv."
# =========================================================
# Send a command and check for errors:
# =========================================================
def do_command(command, hide_params=False):
if hide_params:
(header, data) = string.split(command, " ", 1)
if debug:
print "\nCmd = '%s'" % header
else:
if debug:
print "\nCmd = '%s'" % command
InfiniiVision.write("%s\n" % command)
if hide_params:
check_instrument_errors(header)
else:
check_instrument_errors(command)
# =========================================================
# Send a query, check for errors, return string:
# =========================================================
def do_query_string(query):
if debug:
print "Qys = '%s'" % query
result = InfiniiVision.ask("%s\n" % query)
check_instrument_errors(query)
return result
# =========================================================
# Send a query, check for errors, return values:
# =========================================================
Summary of Contents for InfiniiVision 3000T X Series
Page 1: ...Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide...
Page 40: ...40 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 1 What s New...
Page 50: ...50 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 2 Setting Up...
Page 64: ...64 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 3 Getting Started...
Page 254: ...254 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 8 BUS n Commands...
Page 306: ...306 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 12 DEMO Commands...
Page 364: ...364 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 17 FFT Commands...
Page 442: ...442 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 21 MARKer Commands...
Page 524: ...524 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 22 MEASure Commands...
Page 656: ...656 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 26 POWer Commands...
Page 666: ...666 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 27 RECall Commands...
Page 888: ...888 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 29 SBUS n Commands...
Page 978: ...978 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 30 SEARch Commands...
Page 1240: ...1240 Keysight InfiniiVision 3000T X Series Oscilloscopes Programmer s Guide 38 Error Messages...