Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
21 rating:
 1.80 out of 5     Rate this Document

How Do I Use My New Instrument Driver?

Primary Software: Instrument Drivers/IVI>>IVI Driver Templates
Primary Software Version: 1.52
Primary Software Fixed Version: N/A
Secondary Software: Driver Software>>NI-488.2, Driver Software>>NI-Serial, Instrument Drivers/IVI
Hardware: GPIB, Serial

Problem:
I have downloaded an Instrument Driver from the Instrument Driver Network, NI Developer Zone, or some other source. How can I get started using my new Instrument Driver?

Solution:
This is both an introduction to how to use your Instrument Driver and a set of links to many resources on how to use your Instrument Driver effectively with National Instruments products.

If you plan on developing your own Instrument Driver, please visit our Instrument Driver Development Tools and Resources site on the Instrument Driver Network. It has helpful information on good programming practices and development procedures.


Background

An Instrument Driver is a set of software routines that enables a user to programmatically control the functionality of an instrument. Each routine corresponds to a programmatic operation such as configuring, reading from, writing to, and triggering the instrument. Instrument drivers simplify instrument control and reduce test program development time by eliminating the need to learn the programming protocol for each instrument.

Most Instrument Drivers use NI-VISA, which means that they can support many different buses, including: GPIB, Serial, USB, TCP/IP, PXI, VXI and more.

There are two main types of Instrument Drivers: Interchangeable Virtual Instrument (IVI) Drivers, and Plug and Play drivers. The NI Instrument Driver Network, IDNet, offers both IVI drivers and Plug and Play drivers.
  • IVI drivers use a standard Instrument Driver architecture to provide a high performance interface to instruments. IVI builds on the VXI plug&play specifications and incorporates new features that address issues such as system performance, development flexibility, and instrument interchangeability.
IVI drivers can be used in multiple Application Development Environments (ADE) including LabVIEW, LabWindows/CVI, Visual C++, and Visual Basic. These drivers are currently only available on Win32 systems.
  • Plug and Play drivers, which include LabVIEW and LabWindows/CVI, use a more traditional Instrument Driver architecture which does not incorporate an attribute model like IVI.

Using LabVIEW to Control Your Instrument Driver:

IVI:
IVI instrument drivers are DLL-based drivers developed in LabWindows/CVI. Most IVI drivers on IDNet include LabVIEW support in the form of wrapper VIs. In most cases, you develop a test application with the IVI driver VIs in the same way that you develop a test application with LabVIEW plug and play drivers.

Like LabVIEW plug and play driver VIs, IVI driver VIs are grouped together in functional areas that you combine into an application. Unlike LabVIEW plug and play driver VIs, IVI driver VIs operate differently internally since they rely on the IVI Engine (the main support library) to coordinate and control the IVI features such as simulation, state caching, etc. For this reason, IVI drivers communicate with instruments and the IVI Engine through DLLs (dynamic link libraries).

For more information, please see Using IVI Drivers in LabVIEW.

Plug and Play:
The Plug and Play driver will most likely come in the form of one main Library (LLB or in LabVIEW 8.x and later .LVLIB). It will possibly have some support Libraries, and it will come with several *.mnu files. You can use the VIs in the Instrument Driver Library in your application to control the instrument functionality.  When the LabVIEW Instrument Driver is placed in the instr.lib directory, the Instrument Driver VIs will show up in the function pallet.

For more information on each driver VI, please reference the Context Help for the specific VI go to Help » Show Context Help, and then place cursor over the VI.  Also you can reference the following Developer Zone Tutorial: How to Use an Instrument Driver in LabVIEW Tutorial.


Using LabWindows/CVI to Control Your Instrument Driver:

Instrument driver programs have an associated include file that declares the high-level functions you can call, the global variables you can access, and the defined constants you can use. A LabWindows/CVI instrument driver typically consists of the following three or four files:

  • Source (*.c) file
  • Function Panel (*.fp) file
  • Header (*.h) file
  • .sub file (IVI only).
The instrument driver files must reside in the same directory on your disk, or they must be in the appropriate VXIplug&play or IVI directories.

For more information, please reference go to the main LabWindows/CVI help. To access this from an open CVI project, go to Help » Contents. Under the "Contents>Using LabWindows/CVI", there is an "Instrument Drivers" entry. Double click on the Instrument Drivers help entry to expand the help topics. You can also reference the Developer Zone Tutorial: How to Use an Instrument Driver in LabWindows/CVI Tutorial


Using Visual Basic to Control Your Instrument Driver:

IVI
NI Measurement Studio includes ActiveX controls for communicating with IVI instrument classes. These controls provide a less complicated programming interface to the hardware and enforce interchangeability.

Plug and Play:
National Instruments does not produce any Plug and Play drivers for Instrument Control in Visual Basic. If you have a LabWindows/CVI Plug and Play driver, you need to create a DLL. To use the generated DLLs in Visual Basic, add a project reference to them. They come complete with context-sensitive Help files.


Using Visual C++ to Control Your Instrument Driver:

IVI:
National Instruments provides Measurement Studio Visual C++ instrument driver class libraries for the National Instruments modular instruments and for many third-party vendor instruments.



Related Links:

Interchangeable Virtual Instruments (IVI)
Drivers and Updates: IVI Compliance Package
Developer Zone: Instrument Driver Network
Product Manuals: LabWindows/CVI Instrument Driver Developers Guide
KnowledgeBase 246ARVLS: How Do I Create an Instrument Driver for Visual Basic from the LabWindows/CVI Instrument Driver?
KnowledgeBase 1VCB6D8M: Using Instrument Drivers/IVI in Visual Basic
Developer Zone Tutorial: Instrument Control from Visual Basic
Developer Zone Tutorial: Using IVI Specific Drivers in Visual Basic 6.0, Visual Basic .NET, or Visual C# .NET Applications
Product Manual: LabWindows/CVI Instrument Driver Developers Guide
Developer Zone Tutorial: How to Use an Instrument Driver in LabWindows/CVI Tutorial
Developer Zone Tutorial: How to Use an Instrument Driver in LabVIEW Tutorial.
Instrument Driver Development Tools and Resources



Attachments:





Report Date: 04/16/2001
Last Updated: 10/09/2008
Document ID: 28FFK4QO

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit