Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

How to install DAQmx 8.0.2 and LabVIEW 2011 under RHEL (CentOS) 6

It took me some time to get DAQmx 8.0.2 working under Linux and even more time to get it playing nicely with LabVIEW 2011, so here's a guide that might save some time for aspiring DAQmx users.

Note that DAQmx 8.0.2 is only officially supported with LabVIEW versions 8.0 through 8.6, so no guarantees; that said, I have yet to encounter any problems.

You should definitely check out the README (http://ftp.ni.com/support/softlib//multifunction_daq/nidaqmx/8.0.2LinuxOnly/README.txt) though to make sure your device is supported. We're using the PCI-6259.

A note about troubleshooting

I've made this document publicly editable, so if you encounter a problem and solve it feel free to add it to the Troubleshooting section at the end. Also, if you hit any snags or get strange error messages when attempting this procedure, please add them to the Comments below so we can try to get them resolved.

I) CentOS installation / preparation

a) download

I'm installing the community-supported version of RedHat Enterprise, CentOS 6.2, kernel 2.6.32-220.7.1.el6.i686. The i686 bit is important as it indicates a 32-bit kernel and I don't believe most of this Linux NI software works with 64-bit anything.

You can acquire an ISO here:

http://wiki.centos.org/Download

Burn the ISO to a disc or make a bootable flash drive; some good software for Linux/Windows to accomplish the latter task  is available from https://fedorahosted.org/liveusb-creator/.

b) install

All the defaults should be fine unless you've got some weird setup in which case you probably aren't reading this part very closely anyway.

c) post-install

i) caveats: 8K stack size, 4GB memory limit
    1. Your kernel stack size should be 8K, not the default RHEL value of 4K. This requires you to manually recompile the kernel, which is not as hard as it sounds.
      You can follow the CentOS guide here: http://wiki.centos.org/HowTos/Custom_Kernel
      Ensure that the option "CONFIG_4KSTACKS" is unchecked. I am not entirely sure that CentOS configures its kernels as 4K in which case this somewhat time-consuming step would be unneeded -- I'll try to look into this more closely. It is best to do this for now to be safe (see NeilS' comments at the end of the document).
    2. You need to limit the memory addressable by your system to 4096 MB or less or some of the kernel modules will (rightfully) refuse to load -- see section (ii) immediately below for instructions. This has to do with the 2^32-bit limit.

ii) append to your kernel boot options

Edit your  /boot/grub/grub.conf to include "mem=4096M".

An example:

    title CentOS (2.6.32-220.7.1.el6.i686)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-220.7.1.el6.i686.img ro quiet rhgb mem=4096M

You can also manually add this to the kernel options at boot time by pressing the "a" key at the grub menu.

This may not be necessary if you have < 4GB RAM.

iii) updates via yum

You need to install some extras for the installation (as root):

yum install yum-presto

yum install gcc gcc-c++ kernel-devel kernel-headers make

yum update

The yum-presto bit is optional but saves some download time; the update is just a good idea. The kernel headers et al  are required to compile the various kernel modules you're installing for your specific kernel.

iv) create symbolic link to kernel sources

The DAQmx installation script looks around in some specific places for your kernel source files, and it doesn't find them it gives up on the whole affair. A quick fix is to make a symbolic link to a place that they do look (as root):

ln -s /usr/src/kernels/$(uname -r) /usr/src/linux-$(uname -r)

Sooner or later they will probably fix this part of the script, so this step may become unnecessary. The $(uname -r) bit becomes the name of your running kernel when you execute this command.

II) LabVIEW 2011 for Linux installation

a) mount the image

I think this is generally done with a CD, but if you have an ISO you can mount it using the procedure described below in (III)(b). The CD should automount itself under /media.

b) install LabVIEW 2011

Execute the INSTALL script as root:

sh INSTALL

I installed everything except NI-VISA and NI-GPIB, but maybe you need those. I don't know but hopefully you do.

Reboot after installation.

III) DAQmx 8.0.2 for Linux installation / configuration

a) download the iso

I got the ISO from:

http://joule.ni.com/nidu/cds/view/p/id/2322/lang/en

It is likely worth checking to see if there is a more recent version available.

b) mount the iso

Or you can of course burn it to a disc, but this is easier if you've downloaded it to the same machine on which you'll be installing it.

As root:

mkdir /mnt/loop

mount -o loop <path-to-iso>/DAQmx802f0.iso /mnt/loop

c) read the README

They even put it in all capital letters so you could find it more easily

c) install DAQmx

Execute the INSTALL script as root:

sh INSTALL

I installed the optional support files under /usr/local but you probably don't need them.

Reboot after installation.

d) updateNIDrivers

Execute the updateNIDrivers binary (as root):

/usr/local/bin/updateNIDrivers

This will compile the kernel modules you need for your specific kernel (which is why you installed the kernel headers earlier).

It will print a NOTE like this:


********************************* NOTE *********************************

Using kernel headers found in /lib/modules/2.6.32-220.7.1.el6.i686/source.

If this does not correspond to the location of the 2.6.32-220.7.1.el6.i686 headers,

then define KERNELHEADERS in your environment to point to the location

of the kernel headers, define KERNELTARGET as the version of the

kernel for which to compile, and then rerun ./configure.

********************************* NOTE *********************************


Don't panic! Everything is fine.

e) verify

i) kernel modules

Verify that the kernel modules were loaded alright (as root):

grep -E "nipal|nikal|nidaqmx" /var/log/messages | tail

You should see something like this:

Apr 12 00:29:50 localhost kernel: nikal: module license 'Copyright (c) 2002-2011 National Instruments Corporation.  All Rights Reserved.  Any and all use of the copyrighted materials is subject to the then current terms and conditions of the applicable license agreement, which can be found at <http://www.ni.com/linux/>.' taints kernel.

Apr 12 00:29:51 localhost kernel: nidaqmx_NIXS9x 0000:03:09.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17

Don't worry about that "taints kernel" bit. If you see this:

[nipal] More than 4GB of addressable memory detected.

[nipal] This configuration is not supported.  Check the release notes for more information.

Then you forgot to limit your addressable memory to 4GB or you did it wrong or something. Go back to section (I.c.ii) above.

ii) nilsdev

Execute the command 'nilsdev' (as a normal user) to see what NI devices are detected:

You should see output something like this:

[workstation@localhost ~]$ nilsdev

NI PCI-6259: "Dev1"

[workstation@localhost ~]$

iii) lspci -vv

Double-check that the kernel modules are assigned properly to your card with the command 'lspci -vv' (as a normal user).

You should see output something like this:

[workstation@localhost ~]$ lspci -vv

...

03:09.0 Unassigned class [ff00]: National Instruments PCI-6259

    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-

    Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

    Latency: 64, Cache Line Size: 32 bytes

    Interrupt: pin A routed to IRQ 17

    Region 0: Memory at febff000 (32-bit, non-prefetchable)

    Region 1: Memory at febfe000 (32-bit, non-prefetchable) [size=4K]

    Kernel driver in use: nidaqmx_NIXS9x

IV) Convince LabVIEW 2011 to use  DAQmx

Technically, DAQmx 8.0.2 doesn't support LabVIEW 2011 (or 2010, or 2009). But if you put a slew of DAQmx files in LabVIEW's space, it'll use them all the same.

a) move some files around behind the scenes

This tip was originally suggested to me by BradK and RandyH on the NI Linux group forums. The original post was by NeilS as part of this discussion:

https://decibel.ni.com/content/thread/6883

Essentially, you can just create and execute this script (and modify it if you need it to point to some other places):

export lv86="/usr/local/natinst/LabVIEW-8.6"

export lv11="/usr/local/natinst/LabVIEW-2011"

cp -r ${lv86}/examples/DAQmx ${lv11}/examples

cp -r ${lv86}/examples/instr/niDMM ${lv11}/examples/instr

cp ${lv86}/help/lvdaqmx* ${lv11}/help

cp -r ${lv86}/help/html/*daqmx* ${lv11}/help/html

cp -r ${lv86}/menus/Categories/Measurement/_DAQmx ${lv11}/menus/Categories/Measurement

cp ${lv86}/menus/Categories/Measurement/daqmx.mnu ${lv11}/menus/Categories/Measurement

cp -r ${lv86}/vi.lib/DAQmx ${lv11}/vi.lib

cp ${lv86}/resource/objmgr/daqmx.rc ${lv11}/resource/objmgr

cp ${lv86}/resource/objmgr/daqmx.rch ${lv11}/resource/objmgr

cp ${lv86}/resource/objmgr/filter.vi ${lv11}/resource/objmgr

You'll need to execute this as root.

Troubleshooting

(no trouble yet)

Gratitude

Thanks to everyone for the help! SyamCR, BradK, and RandyH. And NeilS, who is from the looks of it probably the most Linux-savvy person at NI.

Message 1 of 13
(23,228 Views)

Nice howto. Good work!

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 13
(6,448 Views)

Thanks for summarizing your setup here.  I'm sure it will be very helpful to other community members in the future. 

As a quick side note,  I can confirm the 4K stack limitation is a real problem in certain situations and depends entirely on your application.  You can exhast the stack doing some operations with some hardware.  We haven't extensively tested every piece of supported hardware with a 4K stack so we don't have an extensive list of hardware or opertations that might blow the stack.  I have personally seen kernel panics on systems with 4K stacks when performing some operations.  That being said, I have seen many being successful with a 4K stack.  I would highly recommend performing extensive validation of your application if you decide to keep the smaller 4K stack.

0 Kudos
Message 3 of 13
(6,448 Views)

Thanks for the info Neil. I've revised the guide to include a link to the excellent CentOS kernel compilation guide -- probably safest just to spend the hour or so recompiling rather than risk the kernel panics.

0 Kudos
Message 4 of 13
(6,448 Views)

Very good article. Thanks.

CTA, CLA
SuninCNS
0 Kudos
Message 5 of 13
(6,448 Views)

Does this mean it is necessary to recompile CentOS kernel 8k stack size if I only want to use LabVIEW on CentOS? Just a couple of days ago, when I tried to install LabVIEW 2013 on CentOS 6.3, the installation process is OK, but after reboot, the LabVIEW executable does not work. Double-clicking the executable, but nothing happens. What other steps should I do to validate LabVIEW?

0 Kudos
Message 6 of 13
(6,448 Views)

could you run LabVIEW from the console, to see, if there is any error output?

0 Kudos
Message 7 of 13
(6,448 Views)

When I try to run it with command "labview" in terminal, it reports "core dumped".

0 Kudos
Message 8 of 13
(6,448 Views)

Please run the following and place the results in a new discussion forum so you can attach the file:

ulimit -c unlimited

labview

Copy the created "core" or "core.pid" file to the new post. I can then take a look at the stack trace to see what might be the matter.

Also make sure that when you run ldd on /usr/local/natinst/LabVIEW-2013/labview that it finds all of the libraries.

You could also email me the file or place it on a share and sent me the link (click on my profile for my NI email).

0 Kudos
Message 9 of 13
(6,448 Views)

Hi Randy, really thanks for your reply! I tried to send you an email, but there is no such information in you profile. So I just copy the link here, where I uploaded the core file.

0 Kudos
Message 10 of 13
(6,448 Views)