# :SYSTem:ERRor:COUNt?

Error Commands

- :SYSTem:ERRor:COUNt?
- :SYSTem:ERRor:NEXT?

## Query Syntax

    :SYSTem:ERRor:COUNt?

## Description

Returns the string which is the number of errors contained in the error-message buffer. To return the "first in" error, use the `:SYSTem:ERRor:NEXT?` query.

## Example Python 3.x Script

This script opens a session with Infiniium 2026 running on the PC and sends two invalid commands that create two error messages. Infiniium 2026's error buffer is then queried for the errors.

    import pyvisa  # PyVISA package

    rm = pyvisa.ResourceManager()
    Infiniium = rm.open_resource('TCPIP0::localhost::hislip0,4880::INSTR') #HiSLIP

    Infiniium.timeout = 20000 # Set connection timeout to 20s
    Infiniium.read_termination = '\n'
    Infiniium.write(':HAPPY:BIRTHDAY TODAY') # Illegal command for error!
    Infiniium.write(':TIMebase:POSition 2.4E10') # out of range for error!
    error_cnt = int(Infiniium.query(':SYSTem:ERRor:COUNt?'))
    if error_cnt == 0:
        print('\n\tNo Infiniium errors reported.')
    else:
        for i in range(0,error_cnt):
            print(f'\tERROR: {Infiniium.query(":SYSTem:ERRor:NEXT?")}')
    Infiniium.write(':SYSTem:GTLocal')
    Infiniium.close()