:SYSTem:ERRor:COUNT?
Flex Apps:
FlexDCA
FlexRT
FlexPLL
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 FlexPLL running on the PC and sends two invalid commands that create two error messages. FlexPLL's error buffer is then queried for the errors.
import visa # import VISA library rm = visa.ResourceManager() FlexPLL = rm.open_resource('TCPIP0::localhost::hislip0,4880::INSTR') #HiSLIP FlexPLL.timeout = 20000 # Set connection timeout to 20s FlexPLL.read_termination = '\n' FlexPLL.write(':HAPPY:BIRTHDAY TODAY') # Illegal command for error! FlexPLL.write(':TIMebase:POSition 2.4E10') # out of range for error! error_cnt = int(FlexPLL.query(':SYSTEM:ERRor:COUNt?')) if error_cnt == 0: print('\n\tNo FlexPLL errors reported.') else: for i in range(0,error_cnt): print('\tERROR: ' + FlexPLL.query(':SYSTem:ERRor:NEXT?')) FlexPLL.write(':SYSTem:GTLocal') FlexPLL.close()