Agilent 8163A/B, 8164A/B & 8166A/B Mainframes, Fifth Edition 189
6
VISA Programming Examples
How to Use VISA Calls  . . . . . . . . . . . . . . . . . . . . . . . . . . . .190
How to Set up a Fixed Laser Source . . . . . . . . . . . . . . . . .192
How to Measure Power using FETCh and READ  . . . . . .195
How to Co-ordinate Two Modules. . . . . . . . . . . . . . . . . . .199
How Power Varies with Wavelength  . . . . . . . . . . . . . . . .203
How to Log Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207
These programming examples are implemented using MS Developer 
Studio. Regardless of the programming environment you use, keep the 
following in mind: 
• The resultant application is a "console application"
• Make sure the header files 
visa.h
 and 
visatype.h
 are included.
• Make sure the library path includes visa32.lib 
• Ensure that the 
PATH
 environment variable allows loading 
visa32.dll
. 
The programming examples do not cover the full command set for the 
instruments. They are intended only as an introduction, how to program 
the instrument using VISA library calls. 
The VISA calls used, are explained in detail in the VISA User’s Guide.
TIP: Additional programming examples are provided on the Support Disk 
CD-ROM 08164-90BC4
Never use VISA calls and the Agilent 816x VXIplug&play Instrument Driver 
in the same program.
NOTE