
Operating Manual 1302.6163.12 - 03
7.31
R&S ESU
Remote Control – Programming Examples
More Complex Programming Examples
7.3.10.2
Creating a File on the Instrument
In the following example, the TEST1.SET file available on the controller is stored in
the instrument under D:\USER\DATA\DUPLICAT.SET.
REM ************************************************************************
Public Sub WriteFile()
'--------- Generate variables -------------------------------
FileBuffer$ = Space$(100000)
'Buffer for file
Dim digits As Long
'Number of digits of length information
Dim fileBytes As Long
'Length of file in bytes
fileSize$ = Space$(100)
'Length of file as a string
result$ = Space$(100)
'Buffer for simple results
'--------- Default setting of status register ---------------
Call SetupStatusReg
'Configure status register
'--------- Prepare the definite length block data -----------
fileBytes = FileLen("test1.set")
'Determine length of file
fileSize$ = Str$(fileBytes)
digits = Len(fileSize$) – 1
'Determine number of digits of
fileSize$ = Right$(fileSize$, digits)
'length information
FileBuffer$ = "#" + Right$(Str$(digits), 1) + fileSize$
'Store length information in file buffer
'--------- Read file from controller ----------------------
Open "TEST1.SET" For Binary As #1
FileBuffer$ = FileBuffer$ + Left$(Input(fileBytes, #1), fileBytes)
Close #1
'--------- Write file ------------------------------------
status = viWrite(analyzer, "SYST:COMM:GPIB:RTER EOI", 23, retCnt)
'Set receive terminator on the instrument
status = viWrite(analyzer, "MMEM:DATA 'D:\USER\DATA\DUPLICAT.SET'," +
FileBuffer$, 36 + Len(FileBuffer$), retCnt)
'Select file
END SUB
REM ************************************************************************
Summary of Contents for ESU Series
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...