![Rohde & Schwarz 1065.6000.20 Operating Manual Download Page 384](http://html1.mh-extra.com/html/rohde-and-schwarz/1065-6000-20/1065-6000-20_operating-manual_1477758384.webp)
FSE
Programming Examples
1065.6016.12
7.5
E-16
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
Summary of Contents for 1065.6000.20
Page 3: ......
Page 5: ......
Page 17: ......
Page 57: ...Contents Description of Commands FSE 1065 6016 12 I 6 4 E 16...
Page 379: ...Contents Programming Examples FSE 1065 6016 12 I 7 2 E 1...
Page 391: ......
Page 393: ...Contents Maintenance and Instrument Interfaces FSE 1065 6016 12 I 8 2 E 15...
Page 419: ......
Page 421: ...Contents Error Messages FSE 1065 6016 12 I 9 2 E 1...
Page 429: ......