![Rohde & Schwarz 1065.6000.20 Operating Manual Download Page 383](http://html1.mh-extra.com/html/rohde-and-schwarz/1065-6000-20/1065-6000-20_operating-manual_1477758383.webp)
Programming Examples
FSE
1065.6016.12
7.4
E-16
Service Request
The service request routine requires an extended initialization of the instrument in which the respective
bits of the transition and enable registers are set.
In order to use the service request function in conjugation with National Instruments GPIB driver, the
setting "Disable Auto Serial Poll" must be changed to "yes" by means of IBCONF!
REM ---- Example of initialization of the SRQ in the case of errors ------
CALL IBWRT(analyzer%, "*CLS") ’Reset Status Reporting System
CALL IBWRT(analyzer%,"*SRE 168") ’Permit service request for
’STAT:OPER,STAT:QUES and ESR
’register
CALL IBWRT(analyzer%,"*ESE 60") ’Set event-enable bit for
’command, execution, device-
’dependent and query error
CALL IBWRT(analyzer%,"STAT:OPER:ENAB 32767") ’Set OPERation enable bit for
’all events
CALL IBWRT(analyzer%,"STAT:OPER:PTR 32767") ’Set appropriate OPERation
’Ptransition bits
CALL IBWRT(analyzer%,"STAT:QUES:ENAB 32767") ’Set questionable enable bits
’for all events
CALL IBWRT(analyzer%,"STAT:QUES:PTR 32767") ’Set appropriate questionable
’Ptransition bits
ON PEN GOSUB Srq ’Initialization of the service
’request routine
PEN ON
REM Continue main program here
STOP
A service request is then processed in the service request routine.
Note: the variables userN% and userM% must be pre-assigned usefully!
Srq:
REM ------------ Service request routine -----------
DO
SRQFOUND% = 0
FOR I% = userN% TO userM%
’Poll all bus users
ON ERROR GOTO nouser
’No user existing
CALL IBRSP(I%, STB%)
’Serial poll, read status byte
IF STB% > 0 THEN
’This instrument has bits set
’in the STB
SRQFOUND% = 1
IF (STB% AND 16) > 0 THEN GOSUB Outputqueue
IF (STB% AND 4) > 0 THEN GOSUB Failure
IF (STB% AND 8) > 0 THEN GOSUB Questionablestatus
IF (STB% AND 128) > 0 THEN GOSUB Operationstatus
IF (STB% AND 32) > 0 THEN GOSUB Esrread
END IF
nouser:
NEXT I%
LOOP UNTIL SRQFOUND% = 0
ON ERROR GOTO error handling
ON PEN GOSUB Srq: RETURN
’Enable SRQ routine again
’End of SRQ routine
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: ......