02-28-2012 02:57 AM
I managed to install a PC running Redhat and install DAQmx base. lsdaq works and shows:
bash-4.1# lsdaq
--------------------------------
Detecting National Instruments DAQ Devices
Found the following DAQ Devices:
NI USB-6211: "Dev1" (NI-USB-6211)
--------------------------------
As I will connect a microphone to the ai1 port, I would like to have a C program that can read it out. I find it hard to find good documentation to do this (under linux), so I tried the "Measure Frequency" example I found is some package. I changed it a bit so it works with Linux instead of windows (I added the full source to this message). But the example refers to
Configure_ContFreq_IntClk_SCXI1126("SC1Mod1/ai0",1.0,1000.0,1.0,10000.0,0.0,0.2,&taskHandle, NULL);
I changed that to:
Configure_ContFreq_IntClk_SCXI1126("Dev1/ai1",1.0,1000.0,1.0,10000.0,0.0,0.2,&taskHandle, NULL); |
Note: the Configure_ContFreq_IntClk_SCXI1126 function is an internal function that calls DAQmxCreateAIFreqVoltageChan with the string "Dev1/ai1" above.
This generates the following error:
bash-4.1# ./ContFreq_IntClk_SCXI1126_main
DAQmx Error: Device identifier is invalid.
Device Specified: Dev1
Task Name: _unnamedTask<0>
Status Code: -200220
End of program, press any key to quit
My question: is this example right for my device (NI-USB-6211) or are there other C source code examples that are more appropriate?
02-28-2012 08:37 AM
Roalt wrote:
My question: is this example right for my device (NI-USB-6211) or are there other C source code examples that are more appropriate?
Yes, NI-DAQmx Base installs several C examples when you select the C Support option in the INSTALL script. You will find them here:
/usr/local/natinst/nidaqmxbase/examples
Out of curiousity, which version of NI-DAQmx Base do you have installed, and which version of RHEL are you using?
Joe Friedchicken
NI Configuration Based Software Get with your fellow OS users
[ Linux ] [ macOS ]Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
02-29-2012 08:04 AM
Thanks, I have 3.4.5 installed, my complete list of installed packages is:
nidaqmxswitch-1.6.1-f0.i386
nidaqmxcapii-1.6.1-f0.i386
nidaqmxinfi-8.0.1-f0.i386
nidaqmxbase-common-3.4.5-f0.i386
nidaqmxbase-board-support-3.4.5-f0.i386
nidaqmxhelp-1.0.2-f0.i386
nidaqmxcapihelp-1.6.1-f0.i386
nidaqmxbase-cinterface-3.4.5-f0.i386
nidaqmxef-1.4.1-f3.i386
nidaqmxcfgi-1.4.0-f0.i386
nidaqmxcapiexmp-1.6.1-f0.i386
nidaqmxbase-usb-support-3.4.5-f0.i386
I'm running RHEL 6.2 (Red Hat Enterprise linux), kernel is 2.6.32-220.4.1.el6.i686
(I think 'officially' only RHEL 5 is supported), but the drivers seem to work.)
I just tried the first example and it works! Is there any documentation that describes this directory? I'm a bit puzzled to get this answer via a Forum instead of the documentation?
02-29-2012 10:01 AM
Roalt wrote:
Thanks, I have 3.4.5 installed, my complete list of installed packages is:
nidaqmxswitch-1.6.1-f0.i386
nidaqmxcapii-1.6.1-f0.i386
nidaqmxinfi-8.0.1-f0.i386
nidaqmxbase-common-3.4.5-f0.i386
nidaqmxbase-board-support-3.4.5-f0.i386
nidaqmxhelp-1.0.2-f0.i386
nidaqmxcapihelp-1.6.1-f0.i386
nidaqmxbase-cinterface-3.4.5-f0.i386
nidaqmxef-1.4.1-f3.i386
nidaqmxcfgi-1.4.0-f0.i386
nidaqmxcapiexmp-1.6.1-f0.i386
nidaqmxbase-usb-support-3.4.5-f0.i386
The packages in bold are not included with NI-DAQmx Base 3.4.5, but NI-DAQmx 8.0.x for Linux. You may not need those installed if you only require NI-DAQmx Base.
Roalt wrote:
I just tried the first example and it works! Is there any documentation that describes this directory? I'm a bit puzzled to get this answer via a Forum instead of the documentation?
I might return the same sentiment 🙂 For someone who prefers documentation, I'm a bit puzzled to see you skipped the readme 😉 It's included at the root directory of the ISO, but it's also available online [1]. After the installation section, the next sections describe how to detect devices, where to find and how to build the C examples, and where to find the documentation. You'll also find that RHEL 6 is supported as well.
[1] NI-DAQmx Base 3.4.5 readme
http://ftp.ni.com/support/softlib//multifunction_daq/nidaqmxbase/3.4.5/Linux/README.txt
Joe Friedchicken
NI Configuration Based Software Get with your fellow OS users
[ Linux ] [ macOS ]Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
03-01-2012 12:54 AM
Hi Joe,
Thank you for indicating which packages are needed and which not. I initially installed NI-DAQmx, but later found out I needed the NI-DAQmx Base instead so I kept the other installed.
Now I look at the README, I indeed see the examples mentioned (as well as the much needed documentation). I was probably too much occupied finding the right package that I needed (NI-DAQmx, NIDAQmx-Base or NI-VISA) as I couldn't find a good overview of what is needed on linux. I also tried to find the information on the nat. instruments website and there I didn't find references either or the wrong ones pointing to Windows platform developments.
Either way, I'm happy now and if I manage to get the drivers working on my target platform as well (Ubuntu, not officially support but I see that some have managed to get it running on it) then I'm in heaven 😉