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> Instrument Functions<br />

' Set up connection to measuring instrument<br />

ud = RSDLLibfind("89.10.38.97", ibsta, iberr, ibcntl)<br />

If (ud < 0) Then<br />

' Error treatment<br />

End If<br />

' Request instrument settings<br />

Cmd = "SYST:SET?"<br />

Call RSDLLibwrt(ud, Cmd, ibsta, iberr, ibcntl)<br />

' Store instrument response in file<br />

Call RSDLLibrdf(ud, "C:\db.sav", ibsta, iberr, ibcntl)<br />

' Reset instrument<br />

Call RSDLLibwrt(ud, "*RST", ibsta, iberr, ibcntl)<br />

' and restore the previous settings<br />

' to this end disable the END message<br />

Call RSDLLibeot(ud, 0, ibsta, iberr, ibcntl)<br />

' first send off command<br />

Call RSDLLibwrt(ud, "SYST:SET ", ibsta, iberr, ibcntl)<br />

' enable the END message again<br />

Call RSDLLibeot(ud, 1, ibsta, iberr, ibcntl)<br />

' and send the data<br />

Call RSDLLibwrtf(ud, "C:\db.sav", ibsta, iberr, ibcntl)<br />

4.11.2.2 Visual Basic for Applications (Winword and Excel)<br />

RSIB Interface Functions<br />

Programming tips<br />

The programming language Visual Basic for Applications (VBA) is supported as a<br />

macro language by various manufacturers. The programs Winword and Excel use<br />

this language for the versions Winword 97 or Excel 5.0 and higher.<br />

For macros created with Visual Basic for Applications, the same tips are valid as for<br />

Visual Basic Applications.<br />

Programming example<br />

Using the macro QueryMaxPeak, a single sweep with subsequent query of the<br />

maximum peak is performed. The result is entered in a Winword or Excel document.<br />

Sub QueryMaxPeak()<br />

Dim ibsta As Integer<br />

' Status variable<br />

Dim iberr As Integer<br />

' Error variable<br />

Dim ibcntl As Long<br />

' transferred characters<br />

Dim ud As Integer<br />

' Unit Descriptor (handle)for instrument<br />

Dim Response As String<br />

' Response string<br />

4.268 Operating Manual 1313.9681.12 - 01

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

Saved successfully!

Ooh no, something went wrong!