User`s guide

Building a VISA Application in Windows 2
Agilent VISA User’s Guide 21
Libraries Suite\ProgrammingSamples\VB6\VISA\
idn.
5 Select the file idn.bas and click Open. Since the Main()
subroutine is executed when the program is run without requiring
user interaction with a Form, you may delete Form1 if desired. To do
this, right-click Form1 in the Project Explorer window and select
Remove Form1.
6 VISA applications in Visual Basic require the VISA Visual Basic
(VB) declaration file visa32.bas in your VB project. This file
contains the VISA function definitions and constant declarations
needed to make VISA calls from Visual Basic. To add this module to
your project in VB 6.0, from the menu select Project > Add
Module, select the Existing tab, browse to the directory containing
the VB declaration file (by default, this is C:\VXIPNP\WinNT\
include\), select visa32.bas, and click Open.
7 At this point, you can run and debug the Visual Basic project. You
may need to change the VISA interface name and address in the code
to match your device’s configuration.
8 If you want to compile to an executable file, from the menu select
File > Make idn.exe... and click OK. This will create idn.exe in
the idn directory.
Sample Program Source Code
An explanation of the various function calls in the sample is provided
after this program listing. If the program runs correctly, the following is
an example of the output that appears in a message box if your PC is
connected to a 54601A oscilloscope.
HEWLETT-PACKARD,54601A,0,1.7