Remote Control
R&S
®
ESRP
991
User Manual 1175.7445.02 ─ 08
CALL InstrWrite (analyzer, "FORMAT ASCII") 'Set ASCII format
CALL InstrWrite (analyzer, "TRAC:IQ:DATA?")
'Re-measure and read out
'I/Q data
CALL InstrRead(analyzer, asciiResult$)
CALL InstrWrite (analyzer, "TRAC:IQ:STAT OFF")
'Stop I/Q data aquisition
'mode if no further
'measurements are to be
'done
END SUB
REM ************************************************************************
11.17.11
Reading and Writing Files
11.17.11.1
Reading a File from the Instrument
In the following example, the
TEST1.R&S FSV.DFL
file stored under
C:
\R_S\Instr\user
is read from the instrument and stored in the controller.
REM ************************************************************************
Public Sub ReadFile()
'--------- Generate variables ----------------------------------------------
Dim digits As Byte 'Number of digits of
'length information
Dim fileBytes As Long 'Length of file with trace data
'in bytes
result$ = Space$(100) 'Buffer for simple results
'--------- Default setting of status register ------------------------------
CALL SetupStatusReg 'Configure status register
'--------- Read out file ---------------------------------------------------
CALL InstrWrite (analyzer, "MMEM:DATA? 'C:\R_S\Instr\user\TEST1.R&S FSV.DFL'")
'Select file
CALL ilrd(analyzer, result$, 2) 'Read and store number of
digits = Val(Mid$(result$, 2, 1)) 'digits of length information
CALL ilrd(analyzer, result$, digits) 'Read and store length
fileBytes = Val(Left$(result$, digits)) 'information
FileBuffer$ = Space$(fileBytes) 'Buffer for file
CALL ilrd(analyzer, FileBuffer, fileBytes)
'Read file into buffer
CALL ilrd(analyzer, result$, 1) 'Read terminator <NL>
'--------- Store file to controller ---------------------------------------
Open "TEST1.R&S FSV.DFL" For Output As #1
Print #1, FileBuffer; '; to avoid linefeed at
'end of file
Close #1
Remote Control – Programming Examples