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 />

More Complex Programming Examples<br />

status = viRead32(analyzer, QData(Blocks * BlockSize), LastSize * 4,<br />

retCnt)<br />

End If<br />

End If<br />

status = viRead(analyzer, result$, 1, retCnt)<br />

'Read in end character <br />

status = viWrite(analyzer, "TRAC:IQ:STAT OFF", 16, retCnt)<br />

'I/Q data acquisition mode<br />

status = viWrite(analyzer, "DISP:WIND:TRAC:STAT ON", 22, retCnt)<br />

'Re-start screen<br />

status = viWrite(analyzer, "INIT:CONT ON", 13, retCnt)<br />

'continuous sweep on<br />

'--------- Output of binary data as frequency/level pair -----------------<br />

Open ".\traceiq.dat" For Output As #1<br />

'Store in current directory<br />

For i = 0 To IQSamples - 1<br />

Print #1, i; " ; "; Str(IData(i)); " ; "; Str(QData(i))<br />

Next i<br />

Close #1<br />

END SUB<br />

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

7.3.10 Reading and Writing Files<br />

7.3.10.1 Reading a File from the Instrument<br />

In the following example, file TEST1.SET stored under D:\USER\DATA is read from<br />

the instrument and stored in the controller.<br />

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

Public Sub ReadFile()<br />

'--------- Generate variables ------------------------------<br />

Dim digits As Byte<br />

'Number of digits of length information<br />

Dim fileBytes As Long<br />

'Length of file with trace data in bytes<br />

result$ = Space$(100) 'Buffer for simple results<br />

'--------- Default setting of status register ---------------<br />

Call SetupStatusReg<br />

'Configure status register<br />

'--------- Read out file -----------------------------------status<br />

= viWrite(analyzer, "MMEM:DATA? 'D:\USER\DATA\TEST1.SET'", 35, retCnt)<br />

'Select file<br />

status = viRead(analyzer, result$, 2, retCnt)<br />

'Read and store number of<br />

digits = Val(Mid$(result$, 2, 1))<br />

'digits of length information<br />

status = viRead(analyzer, result$, digits, retCnt)<br />

'Read and store length<br />

Operating Manual 1313.9681.12 - 01 7.27

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

Saved successfully!

Ooh no, something went wrong!