Operating instructions

R&S ESCI More Complex Programming Examples
1166.6004.12 7.47 E-1
Configuring and Starting a Printout
The following example shows the configuration of the output format and output device for printing out
the measurement screen.
Proceed in the following order:
1. Set the measurement required for the printout
2. Query available output devices
3. Select an output device
4. Select the output interface
5. Configure the output format
6. Start printout with synchronization to the end
It is assumed that the setting required is a signal with a power of –20 dBm at 100 MHz and that the
printer required is the No. 6 of the printers available. The data is first output on the selected printer, then
to a file.
REM ************************************************************************
Public Sub HCopy()
DIM Devices(100) as string 'Buffer for printer name
FOR i = 0 TO 49
Devices$(i) = Space$(50) 'Preallocate buffer for
'printer name
NEXT i
'--------- R&S ESCI default setting ----------------------------------------
-----
CALL SetupStatusReg 'Configure status register
CALL IBWRT(receiver%,"*RST") 'Reset instrument
CALL IBWRT(receiver%,"INIT:CONT OFF") 'Single sweep
CALL IBWRT(receiver%,"SYST:DISP:UPD ON") 'Display on
'--------- Configure measurement -------------------------------------------
CALL IBWRT(receiver%,"FREQ:CENT 100MHz;SPAN 10MHz") 'Set frequency
CALL IBWRT(receiver%,"DISP:WIND:TRAC:Y:RLEV -10dBm") 'Reference level
CALL IBWRT(receiver%,"INIT;*WAI") 'Perform measurement
'--------- Query regarding available output devices ------------------------
CALL IBWRT(receiver%,"SYST:COMM:PRIN:ENUM:FIRSt?") 'Read out first output
CALL IBRD(receiver%,Devices$(0)) 'device and indicate
PRINT "Drucker 0: "+Devices$(0) 'name
For i = 1 to 99
CALL IBWRT(receiver%,"SYST:COMM:PRIN:ENUM:NEXT?") 'Read out the next
CALL IBRD(receiver%,Devices$(i)) 'printer name
IF Left$(Devices$(i),2) = "''" THEN GOTO SelectDevice 'Abort at end of
'list
PRINT "Drucker"+Str$(i)+": " Devices$(i) 'Indicate printer name
NEXT i