Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't seem to run a PCI-MIO-16E-1 (6070E) faster than half speed

Solved!
Go to solution

I'm new to all of this, so please be understanding. I've got a PCI-MIO-16E-1 running under CentOS 5 with NIDAQBase 3.3.0 and NIKAL 1.1.0. This card ought to be able to do 1.25Ms/s. I need 2 channels running at half this speed, so it's perfect. I've been doing nothing but playing around with the contAcquireNChan.c example that comes with the stack. My first problem was that I found that I couldn't run the card faster than about 20Ks/s. After fooling around with this for a couple days, I upgraded my software stack from 3.2.0, and, lo and behold, I could suddenly run the card faster! I hadn't even changed my code. I was getting 1 channel at 625Ks/s really nicely. Then I changed my code to grab two channels, and I've found that nothing I do can get the card to run faster than half speed. And I'm talking just, say, 650Ks/s. I can run one channel at 625, or 2 at 310, and I assume 4 at 155, etc.

 

If I'm right on the edge, my program will crash after a few seconds with the following error:

DAQmxBase Error: RLP Invoke Node <err>There is <b>not enough data</b> in the DMA buffer to fill the VI's read buffer.  Either request less data, or wait until there is additional data in the DMA buffer.

 

If I'm "over" the small "edge" in sampling rate, the program will crash immediately with:

DAQmxBase Error: DAQmx Base Read.vi
Some or all of the samples requested have not yet been acquired.

 

So my questions are: Am I just misunderstanding how this card works? Should 625Ks/s be the limit? Or am I not calling the functions correctly to get the full throughput? Or, perhaps, given my experience with upgrading to 3.3, is there still something wrong with the drivers? Should I look for a newer version of the software? Can I get an advance copy of the next beta to try? Lastly, should I move to using DAQmx proper (not the "base"), even though it hasn't been updated since 2005 (and I would need to downgrade my OS)?

 

I'm going to attach my (modified) example. This is really, really simple stuff I'm trying to do here. Maybe someone with more experience can spot an obvious error.

 

Many thanks!

dk

 

0 Kudos
Message 1 of 9
(4,029 Views)
If I wanted to talk with the NI folks responsible for the DAQmxBase product on Linux, is there a better board to post on? Is there an IRC channel? Does someone have an email address? Are they accessible in some way?
0 Kudos
Message 2 of 9
(4,018 Views)
Solution
Accepted by David Krider
Hi David,

I'm in the DAQmx Base group, and the AI limit you're encountering is a known flaw in the DMA code. Given that you're using a PCI card in Linux, the best route for you to take is using DAQmx 8.0.1 [1]. True, the driver is old, but your hardware is older 😉

Though we haven't done any in-house testing to know with certainty, CentOS 5 will most likely run DAQmx 8.0.1. Since you've already got NI-KAL 1.10 configured and running, DAQmx 8.0.1 should install relatively easily. From there, you'll have a better performing driver as well as more hardware functionality supported.

However, if the CentOS kernel uses a 4k stack (like newer RedHat releases), you may encounter a kernel panic. If you find yourself in that situation, let me know and you and I can for alternatives.

[1] DAQmx 8.0.1 for Linux
http://joule.ni.com/nidu/cds/view/p/id/1194/lang/en
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)
0 Kudos
Message 3 of 9
(4,003 Views)
Message Edited by B.E.Z. on 09-30-2009 06:27 PM
0 Kudos
Message 4 of 9
(3,997 Views)

Aha! THANK YOU for telling me this. I thought I was just going stupid.

 

I've taken your advice and installed DAQmx 8.0.1 on my system, and -- aside from ignoring some packages because newer versions were already installed -- it seems to have worked. I'm glad you pointed me at 8.0.1. I didn't think it was supposed to apply to RedHat, and it's MUCH newer than 8.0! I reran updateNIDrivers afterward. I don't know how many modules _should_ be loaded, but I have a passle, and I can run `nilsdev'.

 

I'd really rather wait to respond until I know I've got all the bugs worked out, but I see that I've got to learn slightly different API calls (and CALLBACK functions, which I've avoided until now), and get the continuous sampling example hacked up for my situation, and that's going to take (me) awhile. However, I did want to express my gratitude for getting me going again, and saving me from a fate worse than... well, something bad, like installing Windows and Visual Studio. 😉

 

 

0 Kudos
Message 5 of 9
(3,981 Views)

Nice, I'm glad to hear 8.0.1 installed well. Just like DAQmx Base, DAQmx also installs ANSI C examples that demonstrate how to use the API. Have a look in /usr/local/natinst/nidaqmx/examples for a starting point.

 

You don't have to use callbacks if you don't want to, but it helps when you're trying to process data in parallel with acquistion. DAQmx Base is not threadsafe, so we don't provide callbacks for multi-threaded programming. DAQmx is threadsafe, and thus there are callbacks.

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)
0 Kudos
Message 6 of 9
(3,978 Views)
Bump
0 Kudos
Message 7 of 9
(3,901 Views)

As suggested, I got everything setup under Linux, and could finally run the card -- with a SINGLE channel -- full blast. But no matter what I do, I can't get the card to take 2 analog inputs faster than half speed. In fact, when I try, I usually lock up the system after a few seconds.

 

So I decided to take the "linux" out of the equation. I put a new hard drive in the same computer, loaded up the latest DAQmx (9.0), and tried again. SAME THING! Compiling and running the same program under VS Express C++ makes the system unusable!

 

So I fell back again, and just tried to use things like the SignalExpress and MAX applications. And, again, just trying to grab 2 AI's at full speed is impossible. If I'm just a little over half, things get really sluggish. If I go faster, it just gives me an ADC error.

 

What's the bottom line here? This card is rated for 1.25Ms/s. If I grab one channel, I can run full speed. If I try to grab 2 channels, I can't go over 625Ks/s. Is there yet another problem here, or is this just the way the card works? If I run ANY more channels than just one, am I losing sampling speed due to switching the ADC between channels? Have I fundamentally misunderstood this card? I really thought it was perfect: I need 2 channels at 625KHz, EACH. I thought that's what I was getting. With a NON-simultaneous (S-series) card, am I going to lose a clock cycle due to switching the ADC on every read?

0 Kudos
Message 8 of 9
(3,899 Views)

Answered in your other post here.

 

Regards,

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 9 of 9
(3,872 Views)