Specifications
10
VISA-COM programming examples in Visual C#
VISA-COM libraries are used to communicate with instruments on relatively
low-level message-based communication sessions. For most instruments this
means sending SCPI commands and reading/processing data read from the
instrument.
For most customers and most applications, we do not recommend using VISA-
COM libraries for instrument communication. Instead, we recommend using the
Agilent Technologies IVI-COM drivers detailed below. The IVI-COM drivers have
been optimized for each instrument, implement robust error-checking routines,
and offer significant conveniences that most software developers will appreciate.
Additionally, using IVI-COM drivers rather than VISA-COM libraries has a minimal
impact on performance.
To use the VISA-COM libraries in your software development efforts, you first
must reference the VISA-COM library.
4.1 Referencing VISA-COM libraries in Microsoft Visual Studio (VC#)
The Microsoft Visual Studio IDE requires you to reference the VISA-COM
library in each Visual C# project you are intending to use the driver. First, in the
Solution Explorer window, expand the project you want to add the VISA-COM
reference to.
Figure 4. Microsoft Visual Studio, solution explorer window, project reference list
From the Solution Explorer window, right click on “References” and select “Add
Reference”. Alternatively, you can select the Project menu, and select “Add
Reference” from the menu list.
A dialog box will open with a tabbed grouping of reference lists. Several options
are available, including .NET, COM, and local Projects on your computer. The
VISA libraries available from NI or Agilent are COM objects, and as such are
available from the COM references.