14.06.2014 Views

Operating Manual EMI TEST RECEIVER ESIB7 - Rohde & Schwarz

Operating Manual EMI TEST RECEIVER ESIB7 - Rohde & Schwarz

Operating Manual EMI TEST RECEIVER ESIB7 - Rohde & Schwarz

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Programming Examples<br />

ESIB<br />

Service Request<br />

The service request routine requires an extended initialization of the instrument in which the respective<br />

bits of the transition and enable registers are set.<br />

In order to use the service request function in conjugation with National Instruments GPIB driver, the<br />

setting "Disable Auto Serial Poll" must be changed to "yes" by means of IBCONF!<br />

REM ---- Example of initialization of the SRQ in the case of errors ------<br />

CALL IBWRT(receiver%, "*CLS")<br />

’Reset Status Reporting System<br />

CALL IBWRT(receiver%,"*SRE 168")<br />

’Permit service request for<br />

’STAT:OPER,STAT:QUES and ESR<br />

’register<br />

CALL IBWRT(receiver%,"*ESE 60")<br />

’Set event-enable bit for<br />

’command, execution, device-<br />

’dependent and query error<br />

CALL IBWRT(receiver%,"STAT:OPER:ENAB 32767") ’Set OPERation enable bit for<br />

’all events<br />

CALL IBWRT(receiver%,"STAT:OPER:PTR 32767") ’Set appropriate OPERation<br />

’Ptransition bits<br />

CALL IBWRT(receiver%,"STAT:QUES:ENAB 32767") ’Set questionable enable bits<br />

’for all events<br />

CALL IBWRT(receiver%,"STAT:QUES:PTR 32767") ’Set appropriate questionable<br />

’Ptransition bits<br />

ON PEN GOSUB Srq<br />

’Initialization of the service<br />

’request routine<br />

PEN ON<br />

REM Continue main program here<br />

STOP<br />

A service request is then processed in the service request routine.<br />

Note: the variables userN% and userM% must be pre-assigned usefully!<br />

Srq:<br />

REM ------------ Service request routine -----------<br />

DO<br />

SRQFOUND% = 0<br />

FOR I% = userN% TO userM%<br />

’Poll all bus users<br />

ON ERROR GOTO nouser<br />

’No user existing<br />

CALL IBRSP(I%, STB%)<br />

IF STB% > 0 THEN<br />

’Serial poll, read status byte<br />

’This instrument has bits set<br />

’in the STB<br />

SRQFOUND% = 1<br />

IF (STB% AND 16) > 0 THEN GOSUB Outputqueue<br />

IF (STB% AND 4) > 0 THEN GOSUB Failure<br />

IF (STB% AND 8) > 0 THEN GOSUB Questionablestatus<br />

IF (STB% AND 128) > 0 THEN GOSUB Operationstatus<br />

IF (STB% AND 32) > 0 THEN GOSUB Esrread<br />

END IF<br />

nouser:<br />

NEXT I%<br />

LOOP UNTIL SRQFOUND% = 0<br />

ON ERROR GOTO error handling<br />

ON PEN GOSUB Srq: RETURN<br />

’Enable SRQ routine again<br />

’End of SRQ routine<br />

1088.7531.12 7.4 E-16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!