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
- STEP 1: Install LabWindows/CVI Run-time Module for Linux
- STEP 2: Build the IVI-C Specific Driver
- STEP 3: Build a client application of the IVI-C Specific Driver
- 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
- Copy or download the source code files (including the CVI project file) for the driver you want to build.
- Change to the directory where you copied the source files.
- 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.
- 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>.
- Move the generated <prefix>.so file to the /usr/local/vxipnp/linux/bin/ directory. Rename the <prefix>.so file to lib<prefix>.so.
- 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
- Create a LabWindows/CVI project for the application on Windows that uses the driver’s FP file to link to the driver.
- Copy the project file and application source files to the same directory on the Linux machine as the driver source directory.
- 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>.
- 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).
- Type ‘cvicc <appprojectfile> -livi –lvisa’ on the command line, where <appprojectfile> is the CVI project (.prj) file for the application.
- Run the generated executable file to run your application.
METHOD 2: Link to the driver’s dynamic library (.so)
- Complete STEP 2 above to build the specific driver’s dynamic library (.so)
- Create a LabWindows/CVI project for the application on Windows that uses the driver’s FP file to link to the driver.
- Copy the project file and application source files to the same directory on the Linux machine as the driver source directory.
- Edit the application project file to remove the reference to the driver’s FP file.
- 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>.
- 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).
- 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.
- 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)
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/).
