Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1130

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

Advertisement

39
Programming Examples
# =========================================================
# Main program:
# =========================================================
rm = ResourceManagerClass()
InfiniiVision = FormattedIO488Class()
InfiniiVision.IO = rm.Open("TCPIP0::130.29.70.139::inst0::INSTR", \
# Clear the interface.
IMessage.Clear(InfiniiVision.IO)
print "Interface cleared."
# Initialize the oscilloscope, capture data, and analyze.
initialize()
capture()
analyze()
print "End of program."
# Wait for a key press before exiting.
print "Press any key to exit..."
Console.ReadKey(True)
1130
InfiniiVision.WriteString(":SYSTem:ERRor?", True)
error_string = InfiniiVision.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)
AccessMode.NO_LOCK, 0, "Timeout = 15000;")
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
# Not "No error".

Advertisement

Table of Contents
loading

Table of Contents