
20
Agilent VISA User’s Guide
2
Building a VISA Application in Windows
Strings
When reading in a string value with
viVScanf
or
viVQueryf
, you
must pass a fixed length string as the
params
parameter. To declare a
fixed length string, instead of using the normal variable length
declaration:
Dim strVal as String
use the following declaration, where 40 is the fixed length.
Dim strVal as String * 40
Sample VISA Program (Visual Basic)
This section lists a sample program called
idn
that queries a GPIB
instrument for its identification string. This sample builds a standard
.exe
application for WIN32 programs using the Visual Basic 6.0
programming language.
Assuming default installation directories, the
idn
sample files are in
C:\
Program Files\Agilent\IO Libraries Suite\
ProgrammingSamples\VB6\VISA\IDN
Steps to Running the Program
The steps to building and running the
idn
sample program follow.
1
Connect an instrument to a GPIB interface that is compatible with
IEEE 488.2.
2
Start the Visual Basic 6.0 application.
This example assumes you are building a new project (no
.vbp
file
exists for the project). If you do not want to build the project from
scratch, from the menu select
File > Open Project...
and select and
open the
idn.vbp
file. Then skip to Step 7.
3
Start a new Visual Basic Standard
.exe
project. VB 6.0 will open a
new project,
Project1
, with a blank Form,
Form1
.
4
From the menu, select
Project > Add Module
, select the
Existing
tab, and browse to the
idn
directory. If you used default installation
paths, this directory is
C:\Program Files\Agilent\IO
N O T E
Содержание E2094S
Страница 6: ...6 Agilent VISA User s Guide ...
Страница 116: ...116 Agilent VISA User s Guide 4 Programming via GPIB and VXI ...
Страница 126: ...126 Agilent VISA User s Guide 5 Programming via LAN ...
Страница 143: ...Glossary Agilent VISA User s Guide 143 Windows notification area See notification area ...
Страница 144: ...144 Agilent VISA User s Guide Glossary ...