
Quick Start Guide 1313.9652.62 - 02
7.5
R&S FSQ
Brief Introduction to Remote Control
Basic Steps in Programming using the VISA Interface
7.1.2 Initialization and Default State
At the beginning of each program, the VISA resource manager has to be initialized. It opens
a connection to the VISA driver itself, which controls the interaction with all instruments.
7.1.2.1 Creating Global Variables
In Visual Basic, global variables are stored in modules (data extension .BAS). Thus, at least
one module (e.g. GLOBALS.BAS) must be created that contains the variables used by all
subroutines, e.g. the variables for device handlers used by the VISA layer.
For all example programs shown below, the file must contain the following instructions:
Global analyzer As ViSession
Global defaultRM As ViSession
Const analyzerString = "GPIB0::20::INSTR"
Const analyzerTimeout = 10000
The constant analyzerString, specifies the instrument. "GPIB0" specifies the control, whereas
"20" specifies a certain instrument connected to the controller. Assuming the instrument was
connected via a LAN cable and assigned the IP address 192.168.1.1, the corresponding string
would read as:
Const analyzerString = "TCPIP::192.168.1.1::INSTR"
7.1.2.2 Initializing the Controller
This procedure first establishes a connection to the VISA layer and then to the instrument
specified by the analyzerString.
REM ------------ Initializing the controller -------------------------------
Public SUB InitController()
Dim status As ViStatus
status = viOpenDefaultRM(defaultRM)
status = viOpen(defaultRM, analyzerString, VI_NULL, VI_NULL, analyzer)
'Opens connection to Default Resource Manager and returns a handle to it
END SUB
REM ************************************************************************
7.1.2.3 Initializing the Instrument
The instrument is set to its default settings and the status register is cleared.
REM ------------ Initializing the instrument -------------------------------
Public SUB InitDevice()
Dim status As ViStatus
Dim retCnt As Long
status = viWrite(analyzer, "*CLS", 4, retCnt)
'Reset status register
status = viWrite(analyzer, "*RST", 4, retCnt)
'Reset instrument
END SUB
REM************************************************************************
Содержание FSQ series
Страница 1: ...R S FSQ Signal Analyzer Quick Start Guide Quick Start Guide Test Measurement 1313 9652 62 02 ...
Страница 28: ...R S FSQ 0 4 Quick Start Guide 1313 9652 62 02 ...
Страница 50: ...R S FSQ Front and Rear Panel Rear Panel Connections 1 22 Quick Start Guide 1313 9652 62 02 ...
Страница 110: ...R S FSQ Basic Operation Setting Parameters 4 12 Quick Start Guide 1313 9652 62 02 ...
Страница 209: ...Quick Start Guide 1313 9652 62 02 R S FSQ Appendix Appendix ...
Страница 210: ...Quick Start Guide 1313 9652 62 02 R S FSQ Appendix ...
Страница 220: ...R S FSQ Appendix Installing Non Plug Play Printers A 10 Quick Start Guide 1313 9652 62 02 ...