LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AI Acquire Waveform takes up alot of processor time

Well, it'll solve the problem and stick a 50 ms gap in between your data reads. If that's fine, go with it. Otherwise I'd suggest re-ordering your vi and using some sequence structures.
1. Check out the example muliple acqusition examples that ship with LV. Help->Find Examples. Search for "multiple" and look at the software triggered vi's.
2. Use a general sequence structure around the entire vi. Typically, I use the first frame to initialize things and do anything that only needs to be done once for the entire vi (like an intro). The middle frame holds the 'body' of the vi, with all the acqusition and other goodies. Finally, the last frame is the conclusion, or shutting down stuff (cleari
ng memory, resetting buttons, etc.).
3. You may be better off using parallel loops, a fast one for doing the reads, and a delayed one for other stuff.
4. You're also saving every read. While this isn't bad if you have a low data load, at higher rates, you may be better off holding the data and saving at the conclusion of acqusition.
G'Luck
~j5


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 11 of 19
(1,402 Views)
I have tried delays of varying lengths in all of the loops with no improvement. I just tried it again to be sure and have no improvement again.

I also just tried a bare bones vi using only the AI multi point vi writing to a waveform chart. No loops and it runs pretty much the same. I am perplexed.

Dean
0 Kudos
Message 12 of 19
(1,402 Views)
So running with a bare bones version, the original w/ delays, or an example like the one attached precludes you from running any other programs? The CPU monitor may say it's 100%, but it should dump that over to any new program you open.


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 13 of 19
(1,402 Views)
My problem VI and the barebones version use 100% of the processor and it can take up to a minute to open a new window (such as the task manager)or even a minute to stop the VI that is running (via the abort button). Any application is slowed.

The example you attached runs fine and the task manager shows 0% processor while it is running. The pig seems to be in the AI acquire waveforms vi. I am looking into upgrading NI-DAQ to the latest version (I have 6.8 right now) but it doesn't show up in "add/remove programs" so I will have to figure out how to remove it manually before installing the new version.

Thanks for the layout tips! I know my style can be messy.

Did you try my vi?
Did it run ok on your machine?
0 Kudos
Message 14 of 19
(1,402 Views)
If you do not have time to reprogram everything, you can jsut put 1ms delay inside your loop and that will run ok.

if time is the factor then no choice.
0 Kudos
Message 15 of 19
(1,402 Views)
It's actually a fairly simple reprogram. The simple vi's are just that - simple. Note that the previously attached example uses the second level of analog input vi's. Why?
OK, acquisition hierarchy goes like this:
Set Up Acq Params (AI Config)->Start Up Acq (AI Start)->Read Data (AI Read)->Shutdown (Clear AI).
Simple AI Multiread does this EVERY time it runs, so it's constantly reconfiguring the DAQ card, starting it, reading it, clearing, EVREY 10 ms (at 100 Hz scan... every 1 ms at 1000 Hz, etc.). By using the advanced vi's, as in the Contacq example, you do all the config and start junk at the start vi JUST ONCE. So all your computer has to do during ac
quisition is read the DAQ. It's the good ole Set It & Forget It mentality (any Ronco fans out there?). As long as you stick AI Config and AI Start outside the loop and pass the Task ID to the AI Read inside the loop, and finally have AI CLear at the end of the vi outside the loop, everything should be hunky dory.

THERE IS ALWAYS A CHOICE 🙂


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 16 of 19
(1,402 Views)
Yes I agree.

But I think.... it may be not very simple for the begineer in LabVIEW.

Best Regerds,
LV Lover
0 Kudos
Message 17 of 19
(1,402 Views)
First of all, I am embarrassed. When I downloaded your example, I actually ran another example that was in the same directory. It simply wrote random data to a chart and ran quite well of course. I can not run the one you sent as I only have lv version 6.02 and yours is 6.1. Sorry for the confusion.

I have changed my program to use the low level vi's as you describe. It runs much better. Good enough that I can send this message while it is running. And open and close other programs with a noticable but useable delay.

Thanks for the help! That appears to be the solution for the moment.
0 Kudos
Message 18 of 19
(1,402 Views)
I used to programm other cards too and I encountered the same problem.
My advice is to use interrupts, you get an interrupt when an even occurs and you set a semaphore to wait in the while loop untill the event is triggered. (event = e.g buffer full). When this event happends you can execute a small code. This code should release you semaphore and do any other processing. In this way u'll get a 1-4% CPU usage.
This is what I'm trying to do at the moment with the same card but I have problems setting the semaphores and getting the interrupt.
I've done it though on other cards and it worked really well.
Good luck.
0 Kudos
Message 19 of 19
(1,402 Views)