Remote Control
R&S
®
ESR
1022
User Manual 1175.7068.02 ─ 12
'Q data (= 512*1024 bytes)
'Note:
'Visual Basic cannot read in
'data volumes larger than
'512 k words!
Dim digits As Byte 'No. of digits as length
Dim IQBytes As Long 'Length of trace data in bytes
Dim IQValues As Long 'No. of meas. values in buffer
Dim retCount As Integer 'Return count from read
asciiResult$ = Space$(6553600) 'Buffer for ASCII I/Q data
'(= 25*2*1024 bytes)
result$ = Space$(100) 'Buffer for simple results
'--------- Default setting ---------------------------------------
CALL SetupInstrument 'Default setting
CALL InstrWrite (analyzer, "TRAC:IQ:STAT ON")
'Activate I/Q data
'acquisition mode; must be
'done before TRAC:IQ:SET !
'Select number of test points
'(= 512 * 1024 – 512) at
'RBW 10 MHz, 'sample rate 32 MHz,
'trigger free run, pos. trigger
'edge and 0 s trigger delay.
CALL InstrWrite (analyzer, "TRAC:IQ:SET NORM,10 MHz,32 MHz,IMM,POS,0,130560")
'--------- Read-out in binary format----------------------------------------
CALL InstrWrite (analyzer, "FORMAT REAL,32")
'Set binary format
CALL InstrWrite (analyzer, "TRAC:IQ:DATA?")
'M read out I/Q data
CALL viRead(analyzer, result$, 2, retCount)
'Read and store length for
digits = Val(Mid$(result$, 2, 1)) 'number of digits
result$ = Space$(100) 'Re-initialize buffer
CALL viRead(analyzer, result$, digits, retCount)
'Read and store length
IQBytes = Val(Left$(result$, digits))
IQBytes = IQBytes/2 'Divide no. per buffer in half
CALL viRead(analyzer, IData(0), IQBytes, retCount)
'Read I data in buffer
CALL viRead(analyzer, QData(0), IQBytes, retCount)
'Read Q data in buffer
CALL viRead(analyzer, result$, 1, retCount)
'Read in end character <NL>
'--------- Output of binary data as frequency/level pair -----------------
IQValues = IQBytes/4 'Single Precision = 4 Bytes
For i = 0 To IQValues – 1
Print "I-Value["; i; "] = "; IData(i)
Print "Q-Value["; i; "] = "; QData(i)
Next i
'--------- Read-out in ASCII format ----------------------------------------
Remote Control – Programming Examples