:SYSTem:ERRor:NEXT?

Flex Apps:
FlexDCA
FlexRT
FlexPLL
FlexOTO
FlexOTO Instance:
Hardware Diagram
Stations

Query Syntax

:SYSTem:ERRor[:NEXT]?

Description

Queries and clears the last entry in the last-in first-out error-message buffer. The :NEXT child command is optional and is not required. The query returns a string having two comma-separated values. The first field is a number written as a string: 'error number,"error message"'. See the complete listing of error messages.

Repeatedly send this query to clear all errors messages. When the buffer is cleared, the string 0,"No error" is returned. You can use the :SYSTem:ERRor:COUNt? query to return the number of errors in the error-message buffer.

Example Program

The following Python code shows one method of reading FlexOTO's error buffer. The program generates 5 errors and then queries them back and prints them to the console. The errors are generated by sending the command :QUACK:LIKEA:DUCK which we all know doesn't exist!

Copy

print_errors.py

print_errors.py (Python 3.X)

Demonstrates how to read FlexDCA's errors. This script sends 2 incorrect
commands to FlexDCA and then reads and prints the resulting errors.
Requires:
    - Python 3.X
    - PyVISA to use VISA in Python 'https://sourceforge.net/projects/pyvisa/'
    - Enter FlexDCA's VISA address into the script's FLEXDCA_ADDRESS
      global CONSTANT that is located near top of script.

Copyright © 2016 Keysight Technologies Inc. All rights reserved.
You have a royalty-free right to use, modify, reproduce and distribute this
example files (and/or any modified version) in any way you find useful,
provided that you agree that Keysight has no warranty, obligations or
liability for any Sample Application Files.
"""
import visa  # import PyVisa library

FLEXDCA_ADDRESS = 'TCPIP0::localhost::hislip0,4880::INSTR'
rm = visa.ResourceManager()
FlexDCA = rm.open_resource(FLEXDCA_ADDRESS)
FlexDCA.timeout = 10000
FlexDCA.read_termination = '\n'  # Set termination character
FlexDCA.write_termination = '\n'  # Set termination character
FlexDCA.write(':QUACK:LIKEA:DUCK')  # bad command
FlexDCA.write(':TIMebase:POSition 2.4E10')  # out of range for error!
error_list = []
total = int(FlexDCA.query(':SYSTem:ERRor:COUNt?'))
if total:
    for error in range(0, total):
        error_list.append(FlexDCA.query(':SYSTem:ERRor:NEXT?'))
    print(str(total) + ' FlexDCA error messages reported:')
    for error in error_list:
        print('ERROR: ' + error)
else:
    print('No FlexDCA errors reported.')
FlexDCA.write(':SYSTem:GTLocal')  # Close Visa Connection
FlexDCA.close()