EasyManua.ls Logo

Keysight Technologies InfiniiVision MSO-X 4022A

Keysight Technologies InfiniiVision MSO-X 4022A
1580 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
1522 Keysight InfiniiVision 4000 X-Series Oscilloscopes Programmer's Guide
42 Programming Examples
check_instrument_errors(query)
return result
# =========================================================
# Send a query, check for errors, return floating-point value:
# =========================================================
def do_query_number(query):
if debug:
print "Qyn = '%s'" % query
results = InfiniiVision.query("%s" % query)
check_instrument_errors(query)
return float(results)
# =========================================================
# Send a query, check for errors, return binary values:
# =========================================================
def do_query_ieee_block(query):
if debug:
print "Qys = '%s'" % query
result = InfiniiVision.query_binary_values("%s" % query, datatype='s')
check_instrument_errors(query)
return result[0]
# =========================================================
# Check for instrument errors:
# =========================================================
def check_instrument_errors(command):
while True:
error_string = InfiniiVision.query(":SYSTem:ERRor?")
if error_string: # If there is an error string value.
if error_string.find("+0,", 0, 3) == -1: # Not "No error".
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'" % comma
nd
print "Exited because of error."
sys.exit(1)
# =========================================================
# Main program:
# =========================================================
rm = visa.ResourceManager()
InfiniiVision= rm.open_resource("TCPIP0::130.29.70.139::inst0::INSTR")

Table of Contents

Related product manuals