Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

National Instruments Modular Instruments Linux Installation Guide

4 ratings | 4.75 out of 5
Print

Overview

A wide variety of National Instruments modular instruments now work in the Linux OS. This application note is a basic walk-through guide to install and begin using modular instrument drivers in a compatible Linux distribution.

This notet illustrates the installation of the NI-SCOPE driver for scopes and high-speed digitizers, but all NI modular instruments drivers have similar installation steps. Mandriva 2006 is the Linux distribution used in this example, but any compatible Linux distribution will work.

A listing of compatible devices and distributions can be found at
http://www.ni.com/linux/support.htm

The example at the end of this document will use the NI-FGEN driver to produce a signal with an NI signal generator, and then use NI-SCOPE to measure the signal with an NI high-speed digitizer.

Preparing Your Computer

It is best to start with the NI hardware removed from your computer or PXI chassis. You must have the kernel source files installed on your machine so that the NI drivers can correctly detect your configuration. Mandriva Linux and SuSE Linux contain a package named “kernel-source” and Redhat names it “kernel-devel.” Installing these respective packages will install the necessary source files and headers.

See your documentation for help installing these packages.

Downloading the Required Modular Instruments Driver


In your Web browser, download the driver(s) that you need from the following links:

Modular Instruments Drivers for Linux:
http://zone.ni.com/devzone/conceptd.nsf/Webmain/E0FB4D63F95D8187862570D1000740A4?opendocument

Download the necessary file. Note that this file is not an installer; it is an ISO archive containing the installation files.

Once the download has completed successfully, open your console terminal.

See Also:
Modular Instruments Drivers for Linux

Installing LabVIEW 8


Skip this step if you have already installed LabVIEW 8 (or are using a different application development environment, such as with gcc).

Insert your LabVIEW 8 CD into your CD-ROM drive. It will appear in the directory /mnt/cdrom or possibly /mnt/media/cdrom. Check your Linux documentation if you are having issues with your CD-ROM.

To install LabVIEW, you must change your current working directory to the CD-ROM, and run the INSTALL script as root (the superuser account):

su -
(enter root password)
cd /mnt/cdrom
./INSTALL


[+] Enlarge Image

Follow the installation procedure. Contact National Instruments Product Support with any installation problems.

Installing the Modular Instruments Driver(s)


The .iso file you downloaded will now be in the directory you specified in your Web browser. Although you can burn ISO files to CDs, the quickest way to use them is to mount them locally on your computer. To do this, perform the following steps:

mkdir NI-SCOPE_Installer
su
(enter root password)
mount -o loop NISCOPE290_Mandriva2006.iso NI-SCOPE_Installer/

You will now have the installation files in the NI-SCOPE_Installer directory that you created. Enter this directory and read the README.txt file for more information on compatible devices, distributions, and features. You can then follow the instructions to run the installer. The installation process will look similar to the following screenshots:

cd NI-SCOPE-Installer
more README.txt (not performed in screenshot, but highly recommended)
./INSTALL


[+] Enlarge Image

[+] Enlarge Image

Once the installation has been completed, shut down your computer/controller, install your hardware, and turn the system back on.

Device Listing Test


Open a new console terminal. Type in the following command to detect any National Instruments hardware:

nilsdev

If you have successfully installed all necessary drivers and your hardware is not detected, contact National Instruments Product Support.

PXI Controller and Chassis Identification


Skip the following steps if you are not using a PXI-based system.

In order for PXI-specific functions such as triggering and TClk synchronization to work, the drivers must know which hardware is installed, which is done using the nipxiconfing command as the root account.

To see proper usage of nipxiconfig, enter the following command:

nipxiconfig --help

Additionally, the following two commands will be of use to identify your controller and chassis:

nipxiconfig --list-identifiable-controllers
nipxiconfig --list-identifiable-chassis

The system used below is an NI PXI-8185 controller inside of an NI PXI-1052 chassis. The commands to identify them are as follows:

nipxiconfig --identify-controller “National Instruments” “NI PXI-8185”

nipxiconfig --identify-chassis “National Instruments” “PXI-1052”


[+] Enlarge Image

Note: You must spell these identifiers exactly as shown by the --list-identifiable-controller/chassis commands. The version shown above has “NI” in the product name for the controllers, but not for the chassis. This difference has caused confusion with some users.

Running a LabVIEW Example – Signal Generator to Digitizer


Now run a National Instruments example to verify your installation. Each modular instrument driver installs a number of examples for LabVIEW and C (gcc). Find and run an example appropriate to your ADE and hardware.

This example will use LabVIEW with the NI-FGEN driver to produce a function from a National Instruments signal generator, and then measure it with the digitizer installed earlier.

If you have an NI signal generator, install the NI-FGEN driver software and hardware using steps 2 through 5. If you do not have a signal generator, you can skip any steps involving NI-FGEN and measure a different signal.

From a console, start LabVIEW:

labview

Open the NI Example Finder by clicking on the “Find Examples” link on the LabVIEW Welcome Screen (if Example Finder does not run because you did an incomplete LabVIEW installation, use the File >> Open menu to find and open examples.)

Navigate to the Hardware Input and Output >> Modular Instruments >> NI-SCOPE >> Demos folder, as shown below. If you are using a different NI driver, go to that specific folder.

For NI-SCOPE users, double-click on the niScope EX Configured Acquisition.vi example file to open the Configured Acquisition Example, which is located under Hardware Input and Output >> Modular Instruments >> NI-SCOPE >> Demos.


[+] Enlarge Image

The Configured Acquisition VI will open as in the picture below. You must choose the proper resource name to your NI digitizer, which can be found using the nilsdev command. You may need to type the resource name in manually if the pull-down list does not work.


[+] Enlarge Image

Once the Configured Acquisition VI is open and ready to run, return to the Example Finder to find a waveform generation VI to use with your NI signal generator. For instance, if your signal generator is an arbitrary waveform generator, open up the Arbitrary Waveform Example, which can be found under Hardware Input and Output >> Modular Instruments >> NI-FGEN >> Demos >> niFgen_Arbitrary_Waveform_Example.vi. You must have the NI-FGEN driver installed in order for these examples to exist.


[+] Enlarge Image
With the Arbitrary Waveform VI, you can create a unique waveform. In this example, we will create a waveform consisting of a sine wave, a triangle wave, and a square wave using the waveform array.

The waveform array begins with a sine wave at index 0. Use the leftmost increment arrows to change to index 1, and choose a triangle wave inside of the array. Again, use the leftmost increment arrows to change to index 2, and then choose a square wave inside of the array.

Connect a cable between channel 0 of your digitizer and channel 0 of your signal generator. Run the Configured Acquisition VI, and then run the Arbitrary Waveform Example. Your output should look like the picture below:


[+] Enlarge Image

Press the stop button on both VIs. View the NI-SCOPE and NI-FGEN code in each respective VI by showing the block diagram. This can be done by pressing Control-E or by clicking on Window >> Show Block Diagram.

The help files located in /usr/local/natinst/nifgen/doc and /usr/local/natinst/niscope/doc have documentation for each API. There are also examples and papers that can be downloaded from http://zone.ni.com.

Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
See Also:
NI Developer Zone

Related Links:
NI Measurement and Control Products for Linux
4 ratings | 4.75 out of 5
Print

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/).