Install NI Software and Drivers
Install the latest compatible version of the NI-VISA driver and IVI Compliance Package. Check the Readme for system and software compatibility or refer to the following for compatibility information.
Find and Install Instrument Driver
Use the NI Instrument Driver Network to find and install the instrument driver.
- Navigate to the Instrument Driver Network (IDNet).
- To narrow your search to just IVI drivers, expand the Technology filter on the search page and click on IVI.
- Enter the instrument manufacturer and model into the search field and click Search. If you cannot find the driver for your instrument, skip to the Other steps section.
- Click the model name in the search results to display the list of available drivers. The instrument model page will display the available driver types and supported Application Development Environments (ADE) for the instrument.
- Select your driver by clicking Go to Driver Page.
- Download the driver for your ADE version by clicking Download Driver Now.
- Run the self-extracting executable.
- Follow the installer prompts to install the driver. Select Finish when the installation completes.
- Restart the computer after installing the driver.
- Confirm the installation was successful.
- The contents of the .zip file is installed to subdirectory <National Instruments>\LabVIEW<xxxx>\instr.lib/<driver name>.
- The driver installer automatically creates a driver session entry under the Driver Sessions tab in NI MAX and populates the software module information under the Instrument Driver Software Modules item in the Advanced tab in NI MAX.
For the purpose of demonstrating instrument interchangeability later in this tutorial, find and install two IVI-C specific drivers that are from the same class. The IVI class is indicated by the IVI Class Specification and Version on the instrument driver page. This tutorial uses the HP 34401A and Fluke fl45 DMM instrument drivers as examples.
Configure IVI System in NI MAX
Complete the following steps to configure your IVI system in NI Measurement and Automation Explorer (MAX).
Create and Configure a Logical Name
Logical names allow you to define and name multiple driver sessions. You can switch between driver sessions by passing a logical name to the initialize function of a class driver, which identifies the software module and hardware asset to use. Application programs written using a class driver use logical names to avoid direct references to software modules and hardware assets.
- Launch NI MAX from the Start Menu.
- Expand IVI Drivers. If you do not see the IVI Drivers folder, refresh NI MAX.
- Right-click Logical Names and select Create New (case sensitive).
- Replace the default logical name, NewLogicalName, with the new case-sensitive name of your choice, such as MyDmm.
- To configure the properties of the logical name, navigate to the General tab of the logical name. Select the driver session from the Driver Session drop down list and enter a description in the Description field. For this tutorial, select hp34401a as the driver session.
- Click Go To to view and configure the properties of the driver session.
Configure a Driver Session
A driver session defines a set of properties for use by IVI drivers, such as initial settings for attributes, virtual name mappings, simulation settings, and more.
- Selecting Go To from the previous section will expand the driver sessions of the instrument.
- In the General tab, configure the following:
- Enable or disable the appropriate initialization options.
- Select the appropriate Simulate With option.
- If the instrument is physically connected, select Don't Simulate.
- If the instrument is not physically connected or available, select Specific Driver.
Note: If you choose to simulate with a specific driver, the specific driver functions return random simulated values for output parameters that represent instrument data. If you choose to simulate with a class simulation driver, select the simulation driver that matches the class of your specific driver. The simulation driver extends the simulation capabilities built into all specific drivers and allows you to configure the nature of the simulated instrument data interactively. The simulation drivers appear in this list only if they are installed with the IVI Compliance Package.
- If you selected Don’t Simulate from the previous step, navigate to the Hardware tab to add a new hardware asset.
- Click Add to create the hardware asset.
- Enter the name and press Enter.
- Double-click in the Resource Descriptor field. Select a resource from the drop-down list or manually enter the resource descriptor information for the new hardware asset.
- Enter a description for the new hardware asset in Description.
- Make sure to "check" the checkbox of the hardware asset to select it.
- In the Software tab, select a software module if one is not already selected.
- In the Virtual Names tab, modify the existing virtual names or create new ones.
- Click Add.
- In Virtual Name, enter the new virtual name you want to create.
- In Physical Name, select a mapping from the drop-down list or enter a new mapping directly into Physical Name.
- In the Initial Settings tab, you might see one of the following conditions:
- If the Configurable Settings field is enabled, you can add settings to or remove settings from the Initial Settings list. To add settings, highlight a setting in the Configurable Settings list and click Add. To remove settings, highlight a setting in the Initial Settings list and click Remove.
- If the Configurable Settings field is disabled (grayed out), you can only remove settings from the Initial Settings list. To remove settings, highlight a setting in the Initial Settings list and click Remove.
Note: If the driver does not define configurable initial settings, these lists will be empty.
- Click Save IVI Configuration at the top of the configuration view.
- Exit NI MAX.
Run an Example
After configuring the IVI driver, you are ready to run an example. The instrument driver will install examples and the API required to communicate with your instrument. Use these examples as programming references and an easy way to start using your instrument.
LabVIEW
- Launch LabVIEW. Navigate to the Help tab>> Find Examples…>> Hardware Input and Output >> Instrument Drivers >> IVI >> Class.
- Select an example to use with your instrument. For this tutorial, you can select IviDMM-Single Point Measurement.vi.
- Select the proper IVI Logical Name resource and make sure the configuration settings are correct. Run the example.
- Change the configuration settings on the front panel and rerun the example.
Note: If you receive an error message after you change the configuration, the configuration settings may not match those of the instrument.
- Leave the example open and continue to the Interchange Instruments section.
LabWindows/CVI
- Launch LabWindows/CVI. Select Find Examples… from the Welcome page.
- On the Browse tab of NI Example Finder, navigate to Hardware Input and Output >> Instrument Drivers >> IVI >> Class.
- Select an example to use with your instrument. For this tutorial, you can select ividmm.proj.
- Select Run>> Debug <example name>_dbg.exe.
- In the Initialize DMM panel, type the logical name you want to use in the Logical Name field. For this tutorial, you can input MyDmm. Click Initialize.
- In the Configure DMM Panel, make sure the configuration settings are correct and click Configure.
- In the Read DMM Panel, click Read. To take multiple readings, click Read repeatedly.
- To change the configuration settings of the DMM, return to the Configure DMM Panel by clicking Configure.
To view the IVI class driver calls made in this example, select File>>Open>>Source (*.c) to open the source code of the example.
Interchange Instruments
To interchange instruments, update the driver session in NI MAX.
- Launch NI MAX. Expand IVI Drivers in the configuration tree.
- Expand Logical Names and select the appropriate logical name from the list.
- On the configuration panel, select the different driver session that your logical name should refer to from Driver Sessions. For this tutorial, select fl45.
Note: You must install the IVI-C specific driver to see its driver session in the drop-down list.
- If simulating, select Go To and navigate to the General tab of the fl45 driver session. Make sure you select Specific Driver from Simulate With.
- Click Save IVI Configuration.
- Exit MAX. You are now ready to run the example program using the same logical name but a different instrument.
- To verify instrument interchange, repeat the steps in Run an Example section.