Agilent Technologies Infiniium 90000 Series Programmer's Manual page 1057

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

Advertisement

# =========================================================
# Send a query, check for errors, return values:
# =========================================================
def do_query_numbers(query):
myScope.WriteString("%s" % query, True)
result = myScope.ReadList(VisaComLib.ASCIIType_R8, ",;")
check_instrument_errors(query)
return result
# =========================================================
# Check for instrument errors:
# =========================================================
def check_instrument_errors(command):
while True:
\
# =========================================================
# Main program:
# =========================================================
rm = CreateObject("VISA.GlobalRM", \
interface=VisaComLib.IResourceManager)
myScope = CreateObject("VISA.BasicFormattedIO", \
interface=VisaComLib.IFormattedIO488)
myScope.IO = \
rm.Open("TCPIP0::lab-qrex-lp2-10.cos.agilent.com::inst0::INSTR")
# Clear the interface.
myScope.IO.Clear
print "Interface cleared."
# Set the Timeout to 15 seconds.
myScope.IO.Timeout = 15000
print "Timeout set to 15000 milliseconds."
# Initialize the oscilloscope, capture data, and analyze.
Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference
myScope.WriteString(":SYSTem:ERRor? STRing", True)
error_string = myScope.ReadString()
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'"
% command
print "Exited because of error."
sys.exit(1)
# Not "No error".
# 15 seconds.
38
Sample Programs
1057

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents