Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
8 ratings:
 3.87 out of 5   

Using IVI Specific Instrument Drivers in Linux



Hardware: PXI/CompactPCI>>Controllers

Problem:
I would like to use IVI-compliant Instrument Drivers on my Linux system, is this possible?

Solution:
The IVI specifications (IVI-3.1) states that IVI Instrument Drivers can only be IVI-compliant on Windows. Quote from Section 4.2.1:

Note: The IVI Foundation does not define vendor-interoperability and cross-vendor interchangeability for drivers that are ported to other operating systems. Therefore, the IVI Foundation considers such drivers to be non-compliant when used on other operating systems.

Because of that, we will refer to the instrument drivers on Linux as "IVI-style" Instrument Drivers. National Instruments has ported sections of the IVI Engine over to Linux for use with NI Modular Instruments. The ported version of the IVI-style engine does not support interchangeability, just direct calls to the IVI-style Specific Instrument Drivers. The only distributions of Linux that are supported are those that are supported by the Modular Instruments Drivers.

You can install the IVI-style engine for Linux from any of the NI Modular Instruments Drivers as part of the NI LabWindows/CVI Run-Time Module for Linux.

Please take note that the IVI Foundation might define specifications for non-Windows operating systems in the future. Quote from Section 2.16 of IVI-3.1:

2.16 Operating System Dependencies
IVI class specifications are operating system independent. Installation and deployment are operating system dependent. The IVI Foundation recognizes that Microsoft Windows is the most commonly used operating system. Therefore, the initial specifications define how to create and deploy drivers on Microsoft Windows operating systems. Nevertheless, specifications do not preclude driver suppliers from deploying on other operating systems. It should be noted the IVI Foundation might, in the future, define deployment requirements for other operating systems. If so, the specifications might conflict with implementations that predate the standards.


In order to get your Windows-based IVI-C compliant instrument specific instrument driver to work as an IVI-style Instrument Driver on Linux you will need to do the following:

STEP 1: Install LabWindows/CVI Run-time Module for Linux
  1. Make sure you have one of the following Linux distributions installed.
    • Red Hat Enterprise Linux WS 3
    • Red Hat Enterprise Linux WS 4
    • SUSE Linux 10.0
    • SUSE Linux 10.1
    • Mandrakelinux 10.1 Official
    • Mandriva Linux 2006
  2. To install the module from CD, run the INSTALL script from the CD-ROM directory as root and follow the instructions.
  3. When prompted, install NI-VISA , NI-GPIB and the NI-IVI Engine.
STEP 2: Build the IVI Specific Driver
  1. Copy or download the source code files (including the CVI project file) for the driver you want to build.
  2. Change to the directory where you copied the source files.
STEP 3: Build a client application of the IVI Specific Driver
There are two ways you can build an application that is a client of the IVI specific driver you created above. The first method statically compiles and links the specific driver source code into the application. The second method links to the driver’s dynamic library and loads it at run-time.

METHOD 1: Statically build the application with the driver source
  1. Create a LabWindows/CVI project for the application on Windows that uses the driver’s FP file to link to the driver.
  2. Copy the project file and application source files to the same directory on the Linux machine as the driver source directory.
  3. Make sure any references to header files have the correct case. The file system on Linux is case-sensitive: 
#include <IviDmm> is not equal to #include <ividmm.h>
  1. At the top of your main() function, add the following statement to initialize the CVI run-time engine (if it doesn’t already exist):
InitCVIRTE(0, argv, 0);
  1. Type -lvisa’ on the command line, where <appprojectfile> is the CVI project (.prj) file for the application.
  2. Run the generated executable file to run your application.
METHOD 2: Link to the driver’s dynamic library (.so)
  1. Complete STEP 2 above to build the specific driver’s dynamic library (.so)
  2. Create a LabWindows/CVI project for the application on Windows that uses the driver’s FP file to link to the driver.
  3. Copy the project file and application source files to the same directory on the Linux machine as the driver source directory.
  4. Edit the application project file to remove the reference to the driver’s FP file.
  5. Make sure any references to header files have the correct case. The file system on Linux is case-sensitive: #include <IviDmm> is not equal to #include <ividmm.h>
  6. At the top of your main() function, add the following statement to initialize the CVI run-time engine (if it doesn’t already exist):
InitCVIRTE(0, argv, 0);
  1. Type -lvisa -l<prefix>’ on the command line, where <appprojectfile> is the CVI project (.prj) file for the application and <prefix> is the prefix of the specific driver.
  2. Run the generated executable file to run your application


Related Links:
Linux Support: National Instruments and Linux: Frequently Asked Questions
Products & Services: NI LabWindows/CVI Run-Time Module for Linux
On-Demand Training: IVI Fundamentals I - What Are IVI Drivers? (SSP required)
On-Demand Training: IVI Fundamentals II - Why Use IVI Drivers? (SSP required)
NI-VISA Support in Linux
IVI-3.1: Driver Architecture Specification

Attachments:





Report Date: 09/23/2008
Last Updated: 06/13/2012
Document ID: 4PMBOKW1

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