
R&S ESU
Remote Control – Programming Examples
More Complex Programming Examples
7.30
Operating Manual 1302.6163.12 - 03
7.3.10
Reading and Writing Files
7.3.10.1
Reading a File from the Instrument
In the following example, file TEST1.SET stored under D:\USER\DATA 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 ------------------------------------
status = viWrite(analyzer, "MMEM:DATA? 'D:\USER\DATA\TEST1.SET'", 35, retCnt)
'Select file
status = viRead(analyzer, result$, 2, retCnt)
'Read and store number of
digits = Val(Mid$(result$, 2, 1))
'digits of length information
status = viRead(analyzer, result$, digits, retCnt)
'Read and store length
fileBytes = Val(Left$(result$, digits))
'information
FileBuffer$ = Space$(fileBytes)
'Buffer for file
status = viRead(analyzer, FileBuffer, fileBytes, retCnt)
'Read file into buffer
status = viRead(analyzer, result$, 1, retCnt)
'Read terminator <NL>
'--------- Store file to controller -------------------------
Open "TEST1.SET" For Output As #1
Print #1, FileBuffer;
' ; to avoid linefeed at end of file
Close #1
END SUB
REM ************************************************************************
Summary of Contents for 1129.7246.03
Page 1: ...R S ESU EMI Test Receiver Operating Manual 1302 6163 12 03 Test Measurement Operating Manual ...
Page 25: ......
Page 27: ...R S ESU Putting into Operation 1 2 Operating Manual 1302 6163 12 03 ...
Page 29: ...R S ESU Getting Started 2 2 Operating Manual 1302 6163 12 03 ...
Page 31: ...R S ESU Manual Operation 3 2 Operating Manual 1302 6163 12 03 ...
Page 349: ...R S ESU Instrument Functions Basic Settings 4 318 Operating Manual 1302 6163 12 03 ...
Page 405: ...R S ESU Instrument Functions User Port 4 374 Operating Manual 1302 6163 12 03 ...
Page 439: ...R S ESU Remote Control Basics Status Reporting System 5 34 Operating Manual 1302 6163 12 03 ...
Page 841: ...R S ESU Error Messages Device Specific Messages 9 10 Operating Manual 1302 6163 12 03 ...
Page 854: ...Operating Manual 1302 6163 12 03 10 13 R S ESU ...
Page 855: ...R S ESU 10 14 Operating Manual 1302 6163 12 03 ...