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

fileBytes = Val(Left$(result$, digits))<br />

'information<br />

FileBuffer$ = Space$(fileBytes)<br />

'Buffer for file<br />

status = viRead(analyzer, FileBuffer, fileBytes, retCnt)<br />

'Read file into buffer<br />

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

'Read terminator <br />

'--------- Store file to controller -------------------------<br />

Open "TEST1.SET" For Output As #1<br />

Print #1, FileBuffer;<br />

' ; to avoid linefeed at end of file<br />

Close #1<br />

END SUB<br />

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

7.3.10.2 Creating a File on the Instrument<br />

In the following example, the TEST1.SET file available on the controller is stored in<br />

the instrument under D:\USER\DATA\DUPLICAT.SET.<br />

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

Public Sub WriteFile()<br />

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

FileBuffer$ = Space$(100000)<br />

'Buffer for file<br />

Dim digits As Long<br />

'Number of digits of length information<br />

Dim fileBytes As Long<br />

'Length of file in bytes<br />

fileSize$ = Space$(100)<br />

'Length of file as a string<br />

result$ = Space$(100)<br />

'Buffer for simple results<br />

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

Call SetupStatusReg<br />

'Configure status register<br />

'--------- Prepare the definite length block data ----------fileBytes<br />

= FileLen("test1.set")<br />

'Determine length of file<br />

fileSize$ = Str$(fileBytes)<br />

digits = Len(fileSize$) – 1<br />

'Determine number of digits of<br />

fileSize$ = Right$(fileSize$, digits)<br />

'length information<br />

FileBuffer$ = "#" + Right$(Str$(digits), 1) + fileSize$<br />

'Store length information in file buffer<br />

7.28 Operating Manual 1313.9681.12 - 01

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

Saved successfully!

Ooh no, something went wrong!