
NRT
Programming Examples
1080.9506.02
D.5
E-6
Annex D.8
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 conjunction with a 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 IECOUT("*CLS")
’Reset Status Reporting System,
CALL IECOUT("*SRE 168")
’Enable service request for
’STAT:OPER-,STAT:QUES- and ESR-
’registers,
CALL IECOUT("*ESE 61")
’Set Event-Enable bit for
’command execution,device
’dependent and query errors,
CALL IECOUT("STAT:OPER:ENAB 32767")
’Set OPERation Enable Bit
’for all events,
CALL IECOUT("STAT:OPER:PTR 32767")
’Set associated OPERation
’Ptransition bits,
CALL IECOUT("STAT:QUES:ENAB 32767")
’Set Questionable Enable bits
’for all events,
CALL IECOUT("STAT:QUES:PTR 32767")
’Set associated Questionable
’Ptransition bits,
ON PEN GOSUB Srq
’Initialize service
’request routine.
PEN ON
REM -------------------------- Continue main program here -----------------------
STOP
’End of program
REM******************************************************************************
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 Errorhandling
ON PEN GOSUB Srq: RETURN
’Enable SRQ routine again;
’End of SRQ routine.
REM******************************************************************************
REM -------------------------- Subroutines for the individual STB bits ----------
Outputqueue:
’Reading the output buffer.
CALL IECIN(Message$)
PRINT "Message in output buffer:"; Message$
RETURN
深圳德标仪器
135-1095-0799
Содержание NRT 1080.9506.02/.62
Страница 2: ...深圳德标仪器 135 1095 0799 ...
Страница 4: ...深圳德标仪器 135 1095 0799 ...
Страница 6: ...深圳德标仪器 135 1095 0799 ...
Страница 16: ...深圳德标仪器 135 1095 0799 ...
Страница 18: ...深圳德标仪器 135 1095 0799 ...
Страница 178: ...深圳德标仪器 135 1095 0799 ...
Страница 190: ...深圳德标仪器 135 1095 0799 ...