12
Programming Examples
VISA Examples
•
•
•
•
VISA Example in C
To compile and run this example in Microsoft Visual Studio 2005:
1
2
3
4
5
6
7
8
9
/*
* Agilent VISA Example in C
* ------------------------------------------------------------------
626
"VISA Example in C"
"VISA Example in Visual Basic"
"VISA Example in C#"
"VISA Example in Visual Basic .NET"
Open Visual Studio.
Create a new Visual C++, Win32, Win32 Console Application project.
In the Win32 Application Wizard, click Next >. Then, check Empty
project, and click Finish.
Cut- and- paste the code that follows into a file named "example.c" in the
project directory.
In Visual Studio 2005, right- click the Source Files folder, choose Add >
Add Existing Item..., select the example.c file, and click Add.
Edit the program to use the VISA address of your oscilloscope.
Choose Project > Properties.... In the Property Pages dialog, update
these project settings:
a
Under Configuration Properties, Linker, Input, add "visa32.lib" to the
Additional Dependencies field.
Under Configuration Properties, C/C++, Code Generation, select
b
Multi- threaded DLL for the Runtime Library field.
c
Click OK to close the Property Pages dialog.
Add the include files and library files search paths:
a
Choose Tools > Options....
b
In the Options dialog, select VC++ Directories under Projects and
Solutions.
Show directories for Include files, and add the include directory (for
c
example, Program Files\VISA\winnt\include).
d
Show directories for Library files, and add the library files directory
(for example, Program Files\VISA\winnt\lib\msc).
Click OK to close the Options dialog.
e
Build and run the program.
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
on page 626
on page 635
on page 645
on page 659