Operating instructions

Basic Steps of IEC/IEEE-Bus Programming R&S ESCI
1166.6004.12 7.10 E-1
Service Request Routine
A service request is processed in the service request routine.
Note: the variables userN% and userM% must be pre-assigned usefully!
REM ------------ Service request routine ----------------------------------
Public SUB Srq()
ON ERROR GOTO noDevice 'No user existing
CALL IBRSP(receiver%, 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 CALL Outputqueue
IF (STB% AND 4) > 0 THEN CALL ErrorQueueHandler
IF (STB% AND 8) > 0 THEN CALL Questionablestatus
IF (STB% AND 128) > 0 THEN CALL Operationstatus
IF (STB% AND 32) > 0 THEN CALL Esrread
END IF
noDevice:
END SUB 'End of SRQ routine
REM ***********************************************************************
Reading out the status event registers, the output buffer and the error/event queue is effected in
subroutines.
Reading Out the Output Buffer
REM -------- Subroutine for the individual STB bits -----------------------
Public SUB Outputqueue() 'Reading the output buffer
result$ = SPACE$(100) 'Make space for response
CALL IBRD(receiver%, result$)
PRINT "Contents of Output Queue : "; result$
END SUB
REM
***********************************************************************