191
Tel: 886.909 602 109 Email: sales@salukitec.com
192
GPIB interface
Signal Generator
Interface driver
Fig.5.6 Programmable Software and Hardware Layers
5.3.2 Initialization and default status setting
When the program starts, firstly initialize VISA resource manager, and then enable and establish
the communication connection between VISA library and the instrument. The specific steps are as
follows:
5.3.2.1 Generation of global variable
First generate global variables to be recalled by other program modules, for example: Instrument
handle variable. The following example program shall contain the following global variables:
Global ViSession analyzer;
Global ViSession defaultRM;
Const char analyzerString [VI_FIND_BUFLEN] = "GPIB0::20::INSTR";
Const analyzerTimeout = 10000;
Wherein, the constant analyzerString is instrument descriptor, “GPIB0” is controller, and “20” is
the instrument connected to the controller. If supposing that the instrument is connected with LAN
and IP address is “192.168.1.1”,, the variable will be:
Const char analyzerString [VI_FIND_BUFLEN] = " TCPIP::192.168.1.1::INSTR ";
5.3.2.2 Controller initialization
The following example shows how to open and establish a communication connection between
VISA library and the instrument (specified by instrument descriptor).
//Initialize controller: Open the default resource manager and return the instrument handle
analyzer
void InitController()
{
ViStatus status;
VISA
Development environment/programming language
Visual Studio, Visual Basic, Agilent VEE, and CVI/LabWindows, etc.