Keysight Technologies InfiniiVision MSO-X 4022A Programmer's Manual page 1470

Hide thumbs Also See for InfiniiVision MSO-X 4022A:
Table of Contents

Advertisement

42
Programming Examples
# =========================================================
# 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.keysight.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"
1470
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)
# 15 seconds.
Keysight InfiniiVision 4000 X-Series Oscilloscopes Programmer's Guide
# Not "No error".

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the InfiniiVision MSO-X 4022A and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Infiniivision 4000 x seriesInfiniivision mso-x 4032aInfiniivision mso-x 4034aInfiniivision mso-x 4054aInfiniivision mso-x 4104aInfiniivision mso-x 4154a ... Show all

Table of Contents