Programming Examples
R&S®SML / R&S®SMV03
1090.3123.12
E-6
7.4
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 be able to use the service request function in conjugation 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 IBWRT(generatot%, "*CLS") 'Reset status reporting system
CALL IBWRT(generator%,"*SRE 168") 'Permit service request for STAT:OPER-,
'STAT:QUES- and ESR register
CALL IBWRT(generator%,"*ESE 60") 'Set event-enable bit for command, exe-
'cution, device-dependent and query error
ON PEN GOSUB Srq 'Initialization of the service
'request routine
PEN ON
REM Continue main program here
STOP 'End of program
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 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 SML01
Page 4: ......
Page 14: ......
Page 22: ......
Page 32: ......
Page 34: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 42: ......
Page 44: ......
Page 56: ......
Page 62: ......
Page 77: ...R S SML R S SMV03 Menu Summary for R S SML 1090 3123 12 E 6 3 15 Menu Summary for R S SML ...
Page 78: ...Menu Summary for R S SMV03 R S SML R S SMV03 1090 3123 12 E 6 3 16 Menu Summary for R S SMV03 ...
Page 148: ......
Page 240: ......
Page 242: ......