Specifications
ZVx Programming Examples
1043.0009.50 D.5 E-2
Reading out the status event registers, the output buffer and the error/event queue is effected in
subroutines.
REM -------- Subroutines for the individual STB bits ------
Outputqueue: ’Reading the output buffer
Message$ = SPACE$(100) ’Make space for response
CALL IBRD(analyzer%, Message$)
PRINT "Message in output buffer :"; Message$
RETURN
Failure: ’Read error queue
ERROR$ = SPACE$(100) ’Make space for error variable
CALL IBWRT(analyzer%, "SYSTEM:ERROR?")
CALL IBRD(analyzer%, ERROR$)
PRINT " Error text :"; ERROR$
RETURN
Questionablestatus: ’Read questionable status register
Ques$ = SPACE$(20) ’Preallocate blanks to text variable
CALL IBWRT(analyzer%, "STATus:QUEStionable:EVENt?")
CALL IBRD(analyzer%, Ques$)
PRINT "Questionable Status:"; Ques$
RETURN
Operationstatus: ’Read operation status register
Oper$ = SPACE$(20) ’Preallocate blanks to text variable
CALL IBWRT(analyzer%, "STATus:OPERation:EVENt?")
CALL IBRD(analyzer%, Oper$)
PRINT "Operation Status:"; Oper$
RETURN
Esrread: ’Read event status register
Esr$ = SPACE$(20) ’Preallocate blanks to text variable
CALL IBWRT(analyzer%, "*ESR?") ’Read ESR
CALL IBRD(analyzer%, Esr$)
IF (VAL(Esr$) AND 1) > 0 THEN PRINT "Operation complete"
IF (VAL(Esr$) AND 4) > 0 THEN GOTO Failure
IF (VAL(Esr$) AND 8) > 0 THEN PRINT "Device dependent error"
IF (VAL(Esr$) AND 16) > 0 THEN GOTO Failure
IF (VAL(Esr$) AND 32) > 0 THEN GOTO Failure
IF (VAL(Esr$) AND 64) > 0 THEN PRINT "User request"
IF (VAL(Esr$) AND 128) > 0 THEN PRINT "Power on"
RETURN
REM
**********************************************************************
REM ------------- Error routine ----------------
Error handling:
PRINT "ERROR ’Output error message
STOP ’Stop software