18.12.2012 Views

R&S FSQ Signal Analyzer - Rohde & Schwarz

R&S FSQ Signal Analyzer - Rohde & Schwarz

R&S FSQ Signal Analyzer - 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.

R&S <strong>FSQ</strong> Remote Control – Programming Examples<br />

7.2.1.1 Initiate Service Request<br />

Basic Programming Steps for the VISA Interface<br />

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

PUBLIC SUB SetupSRQ()<br />

status = viWrite(analyzer, "*CLS", 4, retCnt)<br />

’Reset status reporting system<br />

status = viWrite(analyzer, "*SRE 168", 8, retCnt)<br />

'Permit service request for STAT:OPER,STAT:QUES and ESR registe<br />

status = viWrite(analyzer, "*ESE 60", 7, retCnt)<br />

'Set event enable bit for command, execution, device-dependent<br />

'and query error<br />

status = viWrite(analyzer, "STAT:OPER:ENAB 32767", 20, retCnt)<br />

'Set OPERation enable bit for all events<br />

status = viWrite(analyzer, "STAT:OPER:PTR 32767", 19, retCnt)<br />

'Set appropriate OPERation Ptransition bits<br />

status = viWrite(analyzer, "STAT:QUES:ENAB 32767", 20, retCnt)<br />

'Set questionable enable bits for all events<br />

status = viWrite(analyzer, "STAT:QUES:PTR 32767", 19, retCnt)<br />

'Set appropriate questionable Ptransition bits<br />

END SUB<br />

REM ***********************************************************************<br />

7.2.1.2 Waiting for the Arrival of a Service Request<br />

There are basically two methods of waiting for the arrival of a service request:<br />

Blocking (user inputs not possible)<br />

This method is appropriate if the waiting time until the event to be signalled by an<br />

SRQ is short (shorter than the selected time-out), if no response to user inputs is<br />

required during the waiting time, and if – as the main criterion – the event is absolutely<br />

certain to occur.<br />

Reason:<br />

From the time the WaitSRQ() function is called until the occurrence of the expected<br />

event, it does not allow the program to respond to mouse clicks or key entries during<br />

the waiting time. Moreover, it causes program abort if the SRQ event does not occur<br />

within the predefined time-out period.<br />

The method is, therefore, in many cases not suitable for waiting for measurement<br />

results, especially with triggered measurements.<br />

The following function calls are required:<br />

status = viEnableEvent(analyzer, VI_EVENT_SERVICE_REQ, VI_QUEUE, VI_NULL)<br />

status = viWaitOnEvent(analyzer, VI_EVENT_SERVICE_REQ, 10000, etype, eevent)<br />

'Wait for service request<br />

IF (result% = 1) THEN CALL Srq<br />

'If SRQ is recognized => subroutine for evaluation<br />

Operating Manual 1313.9681.12 - 01 7.3

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

Saved successfully!

Ooh no, something went wrong!