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

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

Advertisement

# Get numeric values for later calculations.
x_increment = do_query_values(":WAVeform:XINCrement?")[0]
x_origin = do_query_values(":WAVeform:XORigin?")[0]
y_increment = do_query_values(":WAVeform:YINCrement?")[0]
y_origin = do_query_values(":WAVeform:YORigin?")[0]
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):
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:
else:
InfiniiVision.write("%s\n" % command)
if hide_params:
else:
# =========================================================
# Send a query, check for errors, return string:
# =========================================================
def do_query_string(query):
if debug:
result = InfiniiVision.ask("%s\n" % query)
check_instrument_errors(query)
return result
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
time_val = x_origin + (i * x_increment)
voltage = ((values[i] - y_reference) * y_increment) + y_origin
f.write("%E, %f\n" % (time_val, voltage))
(header, data) = string.split(command, " ", 1)
if debug:
print "\nCmd = '%s'" % header
if debug:
print "\nCmd = '%s'" % command
check_instrument_errors(header)
check_instrument_errors(command)
print "Qys = '%s'" % query
Programming Examples
1225
40

Advertisement

Table of Contents
loading

Table of Contents