Remote Control
R&S
®
ESR
619
User Manual 1175.7068.02 ─ 12
It is assumed that the desired setting is a signal at 100 MHz with a power of -20 dBm.
It is also assumed that the sixth printer out of the available printers that are listed is the
one you want. The printout is first output to the selected printer and then to a file.
REM ***********************************************************************
Public Sub HCopy()
Dim retCount as Long
Dim SRQWaitTimeout As Long
Dim eventType As Long
Dim eventVi As Long
Dim statusSRQ As Long
DIM Devices(100) as string 'Create buffer for printer name
FOR i = 0 TO 49
Devices$(i) = Space$(50) 'Preallocate buffer for printer name
NEXT i
'--------- Default setting of the R&S FSV -------------------------------
CALL SetupStatusReg 'Configure status register
CALL InstrWrite(analyzer,"*RST") 'Reset instrument
CALL InstrWrite(analyzer,"INIT:CONT OFF")
'Single sweep mode
CALL InstrWrite(analyzer,"SYST:DISP:UPD ON")
'Screen display on
'--------- Measurement settings ------------------------------------------
CALL InstrWrite(analyzer,"FREQ:CENT 100MHz;SPAN 10MHz")
'Frequency setting
CALL InstrWrite(analyzer,"DISP:TRAC:Y:RLEV -10dBm")
'Reference level
CALL InstrWrite(analyzer,"INIT;*WAI") 'Perform measurement
'--------- Querying the available output devices -------------------------
CALL InstrWrite(analyzer,"SYST:COMM:PRIN:ENUM:FIRSt?")
'Read out and display first output device
CALL InstrRead(analyzer,Devices$(0), 50, retCount)
Debug.Print "Printer 0: "+Devices$(0)
For i = 1 to 99
CALL InstrWrite(analyzer,"SYST:COMM:PRIN:ENUM:NEXT?")
'Read out next printer name
CALL InstrRead(analyzer,Devices$(i)
IF Left$(Devices$(i),2) = "''" THEN GOTO SelectDevice
'Stop at end of list
Debug.Print "Printer"+Str$(i)+": " Devices$(i)
'Display printer name
NEXT i
SelectDevice:
'---- Selection of output device, printer language and output interface ----
CALL InstrWrite(analyzer,"SYST:COMM:PRIN:SEL "+ Devices(6))
'Printer selection #6
CALL InstrWrite(analyzer,"HCOP:DEST 'SYST:COMM:PRIN'")
'Configuration: "Printout to
'printer interface"
CALL InstrWrite(analyzer,"HCOP:DEV:LANG GDI")
Controlling the R&S
ESR Remotely