:SYSTem:ERRor:NEXT?

Instrument:
N1010A
N1000A
DCA-M
Meas. mode:
Scope
Eye
Jitter
TDR
Flex Apps:
FlexDCA
FlexRT
FlexPLL

Query Syntax

:SYSTem:ERRor[:NEXT]? [DIAGnostic]

Description

Queries and clears the last entry in the first-in first-out error message buffer. The :NEXT node is the default SCPI node and is not required. As a result, and these two commands have the same effect in your code:

  • :SYSTem:ERRor:NEXT?
  • :SYSTem:ERRor?

Each time this query is sent, the next error message is removed from the error message buffer. Repeatedly sending this query will eventually clear all errors messages. When the buffer is cleared, the string 0,"No error" is returned. Use the :SYSTem:ERRor:COUNt? query to return the number of errors in the error-message buffer. A complete listing of error messages.

The DIAGnostics argument was added with FlexDCA revision A.08.30.

Without the DIAGnostics argument

The query returns a string having two comma-separated values, the error number following by the error message: '<error number>,"error message"'. For example,

11,"Instrument Error;Timebase Position is set to limit: Entry was out of range"

With the DIAGnostics argument

The query appends an additional field to the returned string that is separated using the ";" character. This additional field contains the portion of the SCPI command string that triggered the error. In this example, an improper number was given:

11,"Instrument Error;Timebase Position is set to limit: Entry was out of range;:TIMebase:POSition 2.4E10"

Example Program

The following Python code demonstrates reading FlexDCA's error buffer with and without the DIAGnostics argument. The program generates 3 errors and then queries them back and prints them to the console. The errors include a command that doesn't exist (:QUACK:LIKEA:DUCK), an illegal color parameter, and a number that is too large.

Copy

errors_print.py

import pyvisa as visa  # import PyVisa library
rm = visa.ResourceManager()
bad_commands = [':QUACK:LIKEA:DUCK',':CHANnel:COLor BRIGHTRED',':TIMebase:POSition 2.4E10']

def print_error_strings(err_query):
    print("\nError strings returned by '" + err_query + "':")
    for command in bad_commands:
        FlexDCA.write(command)
        if FlexDCA.query(':SYSTEM:ERRor:COUNt?'):
            print("\t'" + command + "' error string fields:")
            error_lst = FlexDCA.query(err_query).split(';')
            i = 1
            for s in error_lst:
                print("\t\tField " + str(i) + ": '" + s + "'")
                i += 1
        else:
            continue

FlexDCA = rm.open_resource('TCPIP0::localhost::hislip0,4880::INSTR')
FlexDCA.read_termination = '\n'
FlexDCA .write_termination = '\n'
FlexDCA.timeout = 10000
print()
FlexDCA.write('SYSTem:DEFault')
print('The 3 bad commands sent to FlexDCA:')
for cmd in bad_commands:
    print('\t' + cmd)
print_error_strings(':SYSTem:ERRor:NEXT?')
print_error_strings(':SYST:ERR:NEXT? DIAGnostic')
print()
FlexDCA.write(':SYSTem:GTLocal')
FlexDCA.close()