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

'--------- Read-out in binary format -------------------------------------status<br />

= viWrite(analyzer, "FORMAT REAL,32", 14, retCnt)<br />

'Set binary format<br />

status = viWrite(analyzer, "TRAC:IQ:DATA?", 13, retCnt)<br />

'Meas. + read out I/Q data<br />

' The data must be retrieved from device<br />

' They have the following format:<br />

' Example:<br />

' "#42000"<br />

' |||||______ Length of data in bytes<br />

' |__________ No. of digits as length<br />

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

'Read and store length for<br />

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

'number of digits<br />

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

'Re-initialize buffer<br />

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

'Read length<br />

' Total number of bytes that are read<br />

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

'and store<br />

' Total number of samples (I and Q) that are read<br />

IQSamples = IQBytes / 8<br />

'4 bytes each for I and Q samples<br />

If IQBytes > 0 Then<br />

' Dynamically create buffer for I/Q data<br />

ReDim IData(0 To IQSamples - 1)<br />

ReDim QData(0 To IQSamples - 1)<br />

' "Blocks" with 512 k I/Q data each are read<br />

Blocks = (IQSamples - 1) \ BlockSize<br />

' 0 or 1 block, each with "LastSize" I/Q data, is read<br />

LastSize = IQSamples - (Blocks * BlockSize)<br />

' Entire blocks with 512 k samples each<br />

For Index = 0 To Blocks - 1<br />

' Read I and Q data in buffer; index for I data counts samples<br />

' Size of data for ibrd32 in bytes<br />

status = viRead32(analyzer, IData(Index * BlockSize), BlockSize * 4,<br />

retCnt)<br />

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

retCnt)<br />

Next Index<br />

' The last block (if any) with < 512 k data)<br />

If LastSize > 0 Then<br />

' Read I/Q data; see above<br />

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

retCnt)<br />

7.26 Operating Manual 1313.9681.12 - 01

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

Saved successfully!

Ooh no, something went wrong!