Agilent Technologies Infiniium 90000 Series Programmer's Manual page 1108

Oscilloscopes
Hide thumbs Also See for Infiniium 90000 Series:
Table of Contents

Advertisement

38
Sample Programs
while True:
% command
# =========================================================
# Returns data from definite-length block.
# =========================================================
def get_definite_length_block_data(sBlock):
# First character should be "#".
pound = sBlock[0:1]
if pound != "#":
und
# Second character is number of following digits for length value.
digits = sBlock[1:2]
# Get the data out of the block and return it.
sData = sBlock[int(digits) + 2:]
return sData
# =========================================================
# Main program:
# =========================================================
Infiniium = visa.instrument("TCPIP0::130.29.71.191::inst0::INSTR")
Infiniium.timeout = 20
Infiniium.term_chars = ""
Infiniium.clear()
# Initialize the oscilloscope, capture data, and analyze.
initialize()
capture()
analyze()
1108
error_string = Infiniium.ask(":SYSTem:ERRor? STRing\n")
if error_string:
# If there is an error string value.
if error_string.find("0,", 0, 2) == -1:
print "ERROR: %s, command: '%s'" % (error_string, command)
print "Exited because of error."
sys.exit(1)
else:
# "No error"
break
else:
# :SYSTem:ERRor? STRing should always return string.
print "ERROR: :SYSTem:ERRor? STRing returned nothing, command: '%s'"
print "Exited because of error."
sys.exit(1)
print "PROBLEM: Invalid binary block format, pound char is '%s'." % po
print "Exited because of problem."
sys.exit(1)
Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference
# Not "No error".

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents