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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

More Complex Programming Examples<br />

In binary format, the length information carried in the message header is evaluated<br />

and used for calculating the x-axis values.<br />

Binary data is read in three steps:<br />

1. The number of digits carrying the length information is read.<br />

2. The length information itself is read.<br />

3. The trace data is read.<br />

This procedure is necessary with programming languages like Visual Basic which<br />

support only structures of identical data types (arrays), whereas the binary data format<br />

uses different data types in the header and the data section.<br />

The arrays for measured data are dynamically dimensioned to allow the example<br />

to be easily adapted to individual requirements.<br />

---REM<br />

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

Public Sub ReadIQData()<br />

'--------- Create variables -----------------------------------------------<br />

Dim IData() As Single<br />

'I values as single floats<br />

Dim QData() As Single<br />

'Q values as single floats<br />

Dim digits As Byte<br />

'No. of digits as length information<br />

Dim IQBytes As Long<br />

'Length of trace data in bytes<br />

Dim IQSamples As Long<br />

'No. of trace data in Samples<br />

Dim LastSize As Long<br />

'Length of last block in bytes<br />

Const BlockSize = 524288<br />

'Block size in R&S <strong>FSQ</strong>, as per manual<br />

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

'Buffer for simple results<br />

'--------- R&S <strong>FSQ</strong> default setting ---------------------------------------<br />

Call SetupInstrument<br />

'Default setting<br />

'Activate I/Q data acquisition mode; must be done before<br />

TRAC:IQ:SET!<br />

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

' Number of test points (800 000)<br />

' (max. test points allowed (= 16 * 1024 * 1024 - 512))<br />

' at RBW 50 MHz,sample rate 80 MHz, trigger free run, pos.<br />

trigger edge and 0 s trigger delay.<br />

status = viWrite(analyzer, "TRAC:IQ:SET NORM,50MHz,80MHz,IMM,POS,0,800000",<br />

45, retCnt)<br />

Operating Manual 1313.9681.12 - 01 7.25

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

Saved successfully!

Ooh no, something went wrong!