My company has been developing Automatic Test Equipment applications using LabVIEW for Windows for a number of years. But now we have a couple of potential customers who spit on Windows (which I can understand ) and have specified Linux instead.
So we are looking at how difficult it would be to port our GUI and instrument control VIs to a flavour of Linux supported by NI (RHEL 6.x). We use a number of NI's PXI instruments including the 4072 DMM, the 5114 'scope and the 6289 DAQ. But there seems to me to be a fundamental question / issue about NI's LabVIEW (hereafter LV) support for these instruments:-
If we use the latest LV versions (2103 or 2014) none of the important NI instrument drivers are available (NI-DMM, NI-SCOPE, NI-SWITCH and NI-DAQmx). There are older versions of these drivers available for Linux but they require LV 8.x.
So what are we supposed to do? Go back in time and use LV 8.x and get completely out of step with our Windows development? Or use a modern version of LV and write our own LV drivers using NI-VISA, "DAQmx Base" and whatever else might be available?
NI themselves seem unable to answer this question. Am I missing something?
But now we have a couple of potential customers who spit on Windows (which I can understand ) and have specified Linux instead.
I also prefer Linux than Windows, because Linux more stable, open source and you can order support directly from company, who made distribution, or others and of course they can provide better support for OS, than any other company for Windows without source code.
Now about situation around supporting of different NI hardware in Linux what I tried:
1. NI DAQs card -two drivers exist
a) NI DAQmxBase driver - max. linux kernel version 3.3.x (OpenSuese 12.2, Mageia 2...) or linux kernel 2.6.x (RHEL 6 and clones CentOS 6, Scientific Linux 6 or some old distribution like Mandrake 10.1). Labview VI's up to current version.
b) NI DAQmx - linux kernel 2.6.x (RHEL 6 and clones CentOS 6, Scientific Linux 6 or some old distribution like Mandrake 10.1).
Of couse you can develop you own driver using something like NI SDK. Labview VI's up to Labview 2012, also works with Labview 2013, but with a lot of warnings. I'm not try it in Labview 2014. You can find tutorial in this forum how to add VI's for Labview 8.x to Labview 2011.
NI-Scope 3.1 driver supported only by linux kernel 2.6.x. Probably you can made same trick as with NI DAQmx VI's. I learn how to operate with NI PXI-5122 card using of C/C+ API (converted to Pascal bindings) from FreePascal under Scientific Linux 6 and it works.
Probably your dicision should be based on time support period of your product. There is no information about if NI works on new version of NI DAQmx, NI Scope nad others version, except NI DAQmx Base. RHEL 6 will be supported until year 2021 and there will be some addition extra period, it based on term of linux 2.6.x support period. There is no problem to use Labviw 8.x and newer on PCs based on Intel CPU hardware (NI PXI controllers) with cards supported by NI DAQmx, NI Scope and so on.
In case of developing your own driver, it probably better to add or improve comedy drivers
www.comedy.org (some thing have already done)
and of course prepare new VI's or switch from Labview to other programming language C/C++ (Qt Creator), FreePascal (Lazarus) and so on.
Thanks for that. It's true that we can use DAQmx Base for the 6289 but this means a rewrite of our VI's that interface to any DAQ instrument. Well, not rewrite, I guess it "only" means putting a conditional disable around the DAQmx subVI calls and using the equivalent DAQmx Base subVI's for TARGET_TYPE == Unix. (Not sure why NI didn't keep the same names for the equivalent Base VI's but that's another question.) But for the 4072 DMM and the 5119 scope we don't seem to have that option; there is no modern version of NI-DMM or NI-SCOPE available. And the Comedi project doesn't cover anything except Data Acquisition (BTW your link above is wrong, it should be www.comedi.org).
I quickly tried to install NI-DMM 2.5 with LabVIEW 2013 but it won't due to dependency problems, even if I work around that it hasn't installed the necessary shared library. I can keep trying of course but I still don't know if using LV 2013 is the best approach: rather than spend time getting drivers to work with LV 2013 or writing new ones is it better to go back to LabVIEW 8.x instead? What does everyone else do?
First ask NI about their plans of Linux driver development.
Your problem is that your have a lot of Labview code.
If you plan support your equipment until year 2021 and code adaptation doesn't take a lot of time, it will be better to use Labview 8.x to switch your Windows app to Linux. Use free time to develop new drivers or find other PXI instruments with good Linux and Linux Labview support or switch to classic programming language C/C++ or Pascal (you can program everything).
We also prepare measurement equipment with PXI system: 3xPXI-5122 (supported by NI-Scope and RHEL6), 1xPXI-7841R(FPGA should be programmed in Labview Windows and can communicate with Labview Linux).
For me Labview is not good programming language compare to text base. Bad reading, editing and modify. I plan to program application in FreePascal using C API for NI card and only program FPGA in Labview.
All controllers should be work. Intel platform and there is no probelm with drivers.
But in case of PXI system backplane I don't know if synchronization signals and triggers works. I found some info that addition driver should be installed. I plan to test our PXI system and PXI-5122 next to weeks under Scientific Linux 6.4 (RHEL6.x clone). I can post result here if you want.
I am happy to write C drivers (you can call C from LabVIEw too!). What interface to the instrument hardware do you use? Don't I need a C driver (shared library) from NI?
Presumably you are using the old version of NI-SCOPE (3.1) for your PXI-5122 instruments. My NI-DMM installation fails because it has a dependency on the labview-8.0 package, presumably for some shared libary(s). How have you managed to work around that with NI-SCOPE? What version of LabVIEW are you using?
we have licence only for Labview 2013 and 2014.
1. For DAQs
I installed NIDAQmx or NIDAQmxBase package. Instalation program installs OS drivers and VI's for LabView and shared libraries (so file also knows as C interface or API) libnidaqmx.so or libnidaqmxbase.so (usually it is a symbolic link to so file). You can call shared library from all programming languages, which can call shared library.
Instand of C/C++, you need to translate C header files to bindings files of your programming language. In my case I have prepared bindings for FreePascal. You can call functions from so library from LabView, but you still should prepare Labview binding for shared library. DLL wizard is very limited.
Probably there is a way how to call nidaqmx.so from Labview without error or warnings (I try it only under labview 2013 and get a lot of warnings).
I have installed NI-Scope 3.1 under Scientific Linux 6.4 without problem. I manage PXI-5122 from FreePascal (I prepare Pascal bindings) by calling shared library libniscope.so .
My NI-DMM installation fails because it has a dependency on the labview-8.0 package, presumably for some shared libary(s).
I think I skiped instalation of labview-8.0 package. Other way is install rpm packages without dependence check. Type rpm --help to found info how to disable dependence check.
This week I plan new instalation on PXI system and I let you know my exprience around NI-DAQmx and NI-Scope.
My primary paltform is FreePascal, Labview only for verification and for FPGA programming.
I have made new installation of Scientific Linux 6.4 on PXI system
1. NI PXIe-1078 chassic.
2. NI PXIe-8101 controller.
3. 2x NI PXIe-6602 (do not supported under Linux).
4. 2x NI PXI-5122 (NI-Scope 3.1 for Linux).
1. Install Scientific Linux 6.4 (I did it on another PC and then put HDD driver to PXi controller). Xorg server detects, that two monitor are connected and I see bare desktop VGA1 (any panel), because all this element are in the monitor (you can made screenshot to see monitor configuration), which are not connected: LVDS1(SL 6.4) or LVDS-0 (SL6.6) and VGA1(SL6.4) or VGA-0(SL6.6). To check on which graphic card output monitor are conneted type xrandr -q.
2. Disable LVDS1 in /etc/X11/xorg.conf.
# File generated by XFdrake (rev 262502)
# Refer to the xorg.conf man page for details about the format of
# this file.
Option "DontZap" "False" # disable <Ctrl><Alt><BS> (server abort)
#DontZoom # disable <Ctrl><Alt><KP_+>/<KP_-> (resolution switching)
AllowMouseOpenFail # allows the server to start up even if the mouse does not work
Load "v4l" # Video for Linux
VendorName "Intel Corporation"
BoardName "Intel 810 and later"
Option "Monitor-VGA1" "vga"
Option "Monitor-LVDS1" "dvi"
VendorName "Plug'n Play"
# TV fullscreen mode or DVD fullscreen output.
# 768x576 @ 79 Hz, 50 kHz hsync
ModeLine "768x576" 50.00 768 832 846 1000 576 590 595 630
# 768x576 @ 100 Hz, 61.6 kHz hsync
ModeLine "768x576" 63.07 768 800 960 1024 576 578 590 616
VendorName "Plug'n Play"
# hw reported that monitor are connected
# disable it
Option "Ignore" "true"
3. Install NI-Scope 3.1 (I install it without Labview support). Installation completed with error, that nikal didn't installated. It is ok.
4. Because I need NIDAQmx 8.0.2 I install it. This driver has newer nikal, which installed correctly and made NI-Scope work.
Checked present card by nilsdev
5. I complied binary acquition example from /usr/local/natinst/niscope/examples/c, connected 10 KHz signal with 3V amplitude signal to channel 0 of Dev1.
There is output
I'm impressed! Thanks for sharing that, it will be useful when I have got the scope.
For my part I have been trying to do a similar thing with NI-DMM 2.5:
1. Installed ni-dmm by running 'sudo ./INSTALL' from the iso image. After accepting the licence it asks:
LabVIEW 8.0 not detected
Manually specify a location for LabVIEW 8.0 support files? [yN]
Since I want to use the LabVIEW drivers I answered yes, and specified the default location of /usr/local.
(This would put the drivers into /usr/local/LabVIEW-8.0/instr.lib/niDMM)
I then get a bunch of dependency errors from rpm alog the lines of:
nikali >= 14.0.0 is needed by (installed) nipalki-14.0.0-f0.i386
nikali >= 2.4.0 is needed by (installed) nipxipfki-2.1.0-f0.i386
nipali >= 3.0.0 is needed by (installed) niorberri-3.1.0-fo.noarch
<snip quite a few lines>
nivisa >= 14.0.0 is needed by (installed) nidaqmxbase-usb-support-14.0.0-f0.i386
Error installing NI-DMM 2.5.0f7.
The problem is that I have already got LabVIEW 2013 and NI-VISA 14.0 installed and NI-DMM is trying to update to older versions of these packages, e.g. it is trying to install nikali-1.3.0-f0.i386.rpm. It might work to install NI-DMM before LabVIEW, but for now I copied the iso directory to /tmp, manually edited the INSTALL script to remove the already installed packages from the "installerContentsPackageList" variable and ran INSTALL again. It installed cleanly.
2. Rebooted as requested. Noticed an error duing boot that a couple of ni drivers failed to load; nipalk and nimru2 I think. Needed to do the magic 'updateNIDrivers" command (as root) to fix it - this rebuilds the driver modules for the current kernel.
3. Make it that LabVIEW 2013 can see the NI DMM drivers:
sudo ln -s /usr/local/natinst/LabVIEW-8.0/instr.lib/niDMM /usr/local/natinst/LabVIEW-2013/instr.lib/niDMM
4. Started LabVIEW, created a new VI and added the initialize function from the Measurement I/O -> NI-DMM palette. Placing the function into the block diagram crashes LabVIEW . It could be that I need to reinstall something like N-VISA in order to get the latest kernel drivers; if at first you don't succeed try, try & try again, & again, ...
i tried to install NI-DMM, but I get an error. Instaler said,that I have bad kernel source for my actually running kernel.
I will try to solve it and put info here.
We don't have licence for Labview 8.x. I think for me isn't make sence to try NI-Scope and NI-DMM with Labview 2013,2014. In case of NI-DMM I don't have that hardware.