Agilent Technologies InfiniiVision 2000 X-Series Programmer's Manual page 832

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

Advertisement

38
Programming Examples
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::a-mx3104a-90028.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.
initialize()
capture()
analyze()
print "End of program"
832
myScope.WriteString(":SYSTem:ERRor?", True)
error_string = myScope.ReadString()
if error_string:
# If there is an error string value.
if error_string.find("+0,", 0, 3) == -1:
print "ERROR: %s, command: '%s'" % (error_string, command)
print "Exited because of error."
sys.exit(1)
else:
# "No error"
break
else:
# :SYSTem:ERRor? should always return string.
print "ERROR: :SYSTem:ERRor? returned nothing, command: '%s'" \
% command
print "Exited because of error."
sys.exit(1)
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
# Not "No error".
# 15 seconds.

Advertisement

Table of Contents
loading

Table of Contents