EasyManua.ls Logo

Rohde & Schwarz R&S FSL3 - Page 1653

Rohde & Schwarz R&S FSL3
1734 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
R&S FSL Reading and Writing Files
1300.2519.12 7.25 E-11
Creating a File on the Instrument
In the following example, the TEST1.FSL.DFL file available on the controller is stored in the instrument
under C:\R_S\Instr\user\DUPLICAT.FSL.DFL.
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("H:\work\vb\TEST1.FSL.DFL")
'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 "H:\work\vb\TEST1.FSL.DFL" For Binary As #1
FileBuffer$ = FileBuffer$ + Left$(Input(fileBytes, #1), fileBytes)
Close #1
'––––––––– Write file ––––––––––––––––––––––––––––––––––––––––––––––––––––––
CALL InstrWrite(analyzer, "SYST:COMM:GPIB:RTER EOI") 'Set receive
'terminator on the
'instrument
CALL InstrWrite(analyzer, "MMEM:DATA 'DUPLICAT.FSL.DFL'," + FileBuffer$)
'Select file
END SUB
REM
************************************************************************

Table of Contents

Related product manuals