Using Instrument Drivers - LabVIEW

NI-VISA Measurement & Automation

Using instrument drivers (in LabVIEW)

LabVIEW can use both GWIN Framework instrument drivers and WIN Framework instrument drivers. If you have a GWIN driver for your instrument, you have access to block diagram source code from within LabVIEW. When you use a WIN driver in LabVIEW, the connection to the driver is accomplished via a DLL interface, so you do not have block diagram source code. But you do have native LabVIEW VIs, complete with front panels, icons, help information, and block diagrams (that call the DLL) for each function of the driver.

The first task your program should do is to initialize the connection to the instrument by calling the INITIALIZE function. One of the outputs of the INITIALIZE function is an Instrument ID, which is essentially a handle to the instrument. Once you have initialized your instrument connection, you can then use either the high-level APPLICATION Functions, which perform complete measurement operations, or the lower-level COMPONENT functions, which give you more granularity in controlling the instrument's operation. At the end of your program, you should use the CLOSE function to close the connection to the instrument.

To use a GWIN instrument driver in LabVIEW, you need the following files and software:

  • LabVIEW version 5.0 or later for Windows
  • VISA32.DLL version 2.01 or later
  • instr_name.LLB
  • instr_name.HLP

The instrument driver VIs can be loaded just as any other LabVIEW VIs.

To use a WIN instrument driver in LabVIEW, you need the following files and software:

  • LabVIEW version 5.0 or later for Windows
  • VISA32.DLL version 2.01 or later
  • instr_name.DLL
  • instr_name.H
  • instr_name.HLP
  • instr_name.LLB

WIN drivers are written in C using LabWindows/CVI. So, before you can use a WIN instrument driver in LabVIEW, you must use LabVIEW to convert the driver into LabVIEW VIs automatically. Launch LabVIEW and select File»Convert CVI FP File... (LabVIEW 5.x) or Tools»Instrumentation»Import CVI Instrument Driver (LabVIEW 6.x). You are prompted for both the .FP and .DLL files. Once you have converted a WIN instrument driver into a LabVIEW library (.LLB file), you can use the VIs like any other LabVIEW VIs.

Take advantage of the online help when using your VXIplug&play instrument driver. The help describes each component of the driver and shows a hierarchical outline of its components. When using LabVIEW, you can use the standard Windows Help system to access the instrument's Windows Help file.