:SYSTem:ERRor:COUNT?

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

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 FlexOTO running on the PC and sends two invalid commands that create two error messages. FlexOTO's error buffer is then queried for the errors.

import visa # import VISA library

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

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