Using Ivi Drivers In Labview
An instrument driver is a set of software routines that control a programmable 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.IVI-COM is one of several instrument driver technologies that you can use with LabVIEW. The IVI Foundation defines two architectures for IVI drivers: IVI-C, which is based on ANSI C, and IVI-COM, which is based on Microsoft COM technology.
For information on the differences between IVI-C and IVI-COM drivers, refer to the.In general, a driver with a customized LabVIEW interface is easiest to use in LabVIEW. LabVIEW Plug and Play and IVI-C drivers with LabVIEW wrappers are available on the. You should consider all driver choices available, and choose the driver that best fits your needs.In some cases, a driver with a simple LabVIEW interface is unavailable. In those cases, you can program the COM objects directly with LabVIEW’s ActiveX functions.This document describes how to use Agilent's IVI-COM driver for the 34401A DMM in a simple LabVIEW application. Use these instructions as a guideline for using other IVI-COM drivers in LabVIEW.Table of Contents. A) NI-488.2, if a National Instruments GPIB interface is usedb) NI-VISA, for VISA-COM supportc) IVI Compliance Package, for the IVI Shared Components3), required for older Agilent IVI-COM drivers.4), required by Agilent IVI-COM drivers. For compatibility with National Instruments GPIB interface cards, install version 14.0 of the Agilent IO Libraries Suite.
Agilent IO Libraries Suite version 14.0 is not the most current version of the IO Libraries Suite, but later versions of the Agilent IO Libraries Suite are not compatible with National Instruments GPIB interface cards.5).Note: If the IVI-COM driver installs a.NET Primary Interop Assembly, you need to install the Microsoft.NET Framework.Note: If you have already installed Agilent IO Libraries Suite version 14.1, you may have to uninstall/reinstall or repair all the Agilent components to use Agilent IO Libraries Suite version 14.0.2. Using IVI-COM Drivers in LabVIEWBecause an IVI-COM driver is an ActiveX-enabled technology, use the LabVIEW ActiveX functions to access IVI-COM properties and methods in LabVIEW.
Complete the following steps to create a simple LabVIEW IVI-COM application.1) Launch LabVIEW and create a new VI.2) Open the ActiveX palette and place the Automation Open function on the block diagram.3) Right-click the function and select Select ActiveX ClassBrowse from the shortcut menu. A dialog box appears, shown in Figure 1. Figure 1: Selecting a Type Library in ActiveX Class Browser4) From the Type Library pull-down menu, select the IVI-COM driver. The Type Library list contains the type libraries for all the registered ActiveX servers on the system in alphabetical order. This list can be long, so you might need to browse for keywords that match the driver, such as the vendor name or 'IVI'.
If you cannot find the driver in this list, use the Browse button to select the driver DLL in the IVIBin directory.5) After you select the type library, the Objects list contains all the IVI-COM objects and interfaces associated with the driver. Place a checkmark in the Show Creatable Objects Only check-box to display only objects that you can create. IVI-COM drivers have one creatable object and multiple interfaces.6) Select the interface with which you want to start. For IVI-COM drivers, select the interface which defines the Initialize method. This is typically the first interface in the list.7) Click the OK button to return to the block diagram after you have selected the type library, object, and interface. The block diagram should now appear similar to Figure 2.
Ni Driver Support
Figure 2 shows the type library, object and interface selection for the Agilent 34401 IVI-COM instrument driver. Figure 2: Automation Open and type library refnum8a) Select ViewClass Browser to display the Class Browser dialog box.8b) From the Object library pull-down menu, select ActiveXSelect Type Libraries to display the Select Type Libraries dialog box, shown in Figure 3. Select the same type library you selected for the Automation Open refnum. You will see a list of properties and methods supported by the Agilent 34401 IVI-COM driver, shown in Figure 3.8c) Select the Initialize method and click the Create button to attach the Initialize method to the mouse cursor. Click on the block diagram to place the Initialize method on the diagram.8d) Wire the Initialize method to the Automation Open function, shown in Figure 5.
Figure 5: Automation Open and Initialize method10a) To access operations other than Initialize and Close, use the Class Browser window to navigate to the desired operation. Dottable properties have a blue glyph next to the property name. Dotted properties are a shorthand alternative to cascading multiple Property Nodes that return interface references needed for wiring properties and methods specific to a given interface. For example, to create a dottable property to enable autorange on the DMM for DC voltage measurements, double-click on PropertiesDCVoltage.
The class interface changes and a new set of properties and methods are now selectable, shown in Figure 6.10b) Select PropertiesAutoRange and click the Create button to drop the AutoRange property on the block diagram, shown in Figure 7. Figure 7: Using dotted properties and methods3. Additional InformationYou should close references to all ActiveX sessions and interfaces when you are finished using them. In Figure 7, notice that the sessions to the DCVoltage interface and to the driver session are closed after they are used.To access help for an interface, property, or method, right-click on the node and select Help For from the shortcut menu. An example of how to access the help for the Initialize method is shown in Figure 9. Figure 10: Viewing context help for AutoRange propertyLinks to complete examples demonstrating how to execute the Measurement method and read the measured value are provided at the end of this document.IVI-COM drivers use the variant data type to pass array data.
To convert variant data into a LabVIEW data type, use the Variant to Data function located in the ActiveX palette. Refer to the instrument driver help to determine the array data type. Figure 11 demonstrates how to convert variant data from an IVI-COM driver to a double precision array. More details about the Variant to Data function can be found in the LabVIEW Help.