Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: May 05, 2012


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links -Products and Services

Porting IVI-C Specific Drivers and Applications to Linux

5 Ratings | 3.80 out of 5
Read in  |  Print |  PDF

Overview

This document describes how to port IVI-C specific drivers and IVI-C specific driver client applications to Linux using the LabWindows/CVI Run-time Module for Linux.

System Requirements

In order to install the LabWindows/CVI Run-time Module for Linux, you must install one of the following Linux distributions:

    • 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

In addition, you must have at least 200 MB of free hard disk space.

Table of Contents

  1. STEP 1: Install LabWindows/CVI Run-time Module for Linux
  2. STEP 2: Build the IVI-C Specific Driver
  3. STEP 3: Build a client application of the IVI-C Specific Driver
  4. Related Links

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-488.2, and the NI-IVI Engine.

STEP 2: Build the IVI-C 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.
  3. Type ‘cvicc <projectfile> -livi -lvisa’ on the command line, where <projectfile> is the CVI project (.prj) file for the driver. A file with the name <prefix>.so will be generated.
  4. 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>.
  5. Move the generated <prefix>.so file to the /usr/local/vxipnp/linux/bin/ directory. Rename the <prefix>.so file to lib<prefix>.so.
  6. Create a symbolic link to the driver file in the /usr/local/lib directory by using the command ‘ln -s /usr/local/vxipnp/linux/bin/lib<prefix>.so /usr/local/lib/lib<prefix>.so’.

STEP 3: Build a client application of the IVI-C Specific Driver

There are two ways you can build an application that is a client of the IVI-C 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>.
  4. At the top of your main() function, add the InitCVIRTE(0, argv, 0); statement to initialize the CVI run-time engine (if it doesn’t already exist).
  5. Type ‘cvicc <appprojectfile> -livi –lvisa’ on the command line, where <appprojectfile> is the CVI project (.prj) file for the application.
  6. 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 InitCVIRTE(0, argv, 0); statement to initialize the CVI run-time engine (if the statement doesn’t already exist).
  7. Type ‘cvicc <appprojectfile> -livi –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.
  8. Run the generated executable file to run your application.

Related Links

On-Demand Training: IVI Fundamentals I - What Are IVI Drivers? (SSP required)

On-Demand Training: IVI Fundamentals II - Why Use IVI Drivers? (SSP required)

5 Ratings | 3.80 out of 5
Read in  |  Print |  PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).