LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Constant grab takes too much ressource

Hi!

I need a programm with several threads. One thread is aquiring images constantly. The problem is that the other threads are very very very slow while aquiring images. Is there a trick or any other solution???

I am using LabView 6.1 Base Package. I do not use Vision!!

Thanks
Starter
0 Kudos
Message 1 of 9
(3,431 Views)
Hello,

When you say "thread", what do you mean? If you mean that you have parallel loops in your program, an easy way to free up CPU time between the loops is to add a "Wait" function for 100 ms or so inside each of the loops. This will allow the loops to "rest" for a short time, allowing the CPU to take care of other waiting computations.

If you mean that you have several subVIs within a mainVI, you can control the execution priority of each of the subVIs from VI Properties >> Execution (under the File menu).

If neither of these suggestions help, please give more information about your application, or ideally, attach all or part of your application to examine. Have a great day!

Liz Fausak
National Instruments
0 Kudos
Message 2 of 9
(3,431 Views)
Hi!

I think you got the problem! I have many case - structures - one sub vi in each of it. Parallel to these structures I need to grab, but even putting a wait - function into the aquiring-loop doesn't work.

It seems as if during aquiring no other 'thread' works. It isn't even possible to exit the program wich is just clicking a button that exits a loop.

I'm sorry, but at the moment I am not able to submit the vi, but if there is no other way to find a solution I will do another example.

Any idea???

Thanks - Starter
0 Kudos
Message 3 of 9
(3,431 Views)
Hello,

How many images are you grabbing each time? You might want to just grab one or several images, rather than many, and put the wait function in. Most likely your loop is just waiting to complete the acquisition of a large number of images.

Also, try looking at your program execute with "Highlight Execution" enabled. (Just click on the light bulb on the debugging toolbar). Then you will be able to easily see what is taking the most execution time, and go from there.

I hope this helps!

Liz Fausak
National Instruments
0 Kudos
Message 4 of 9
(3,431 Views)
Hi again!

I think I found the problem. I extracted the image aquisition routines from the program and put it to a new vi that was just to grab pictures.
I need to do a permanent grab - so I cannot say how many pictures I need to grab.

Running the new vi showed me, that there is only one picture grabbed per secound. Is this normal??? I need to do true color images, but I can't imagine that this should take 1s/image.

Any further idea???

Hope you can help me again.

Thanks - Starter

If it helps I can post the new grab-vi here.
0 Kudos
Message 5 of 9
(3,431 Views)
Hello,

It probably would help if you could post the VI here. It sounds like you may be using image acquisition hardware or software, but you said earlier that you are not using NI Vision, so I would like to clarify the type of "picture grab" you are doing.

You should be able to set the rate of acquisition of your pictures, to be faster or slower, but it depends on the VI you are using.

When you say "permanent grab", do you mean a continuous image acquisition? If so, you could still grab only one or a few images at a time, and put the code inside of a loop with a wait function in order to free up CPU time.

Please let me know if you'd like for me to help further, or if you would like me to take a look at your VI. Have a
great weekend!

Liz Fausak
National Instruments
0 Kudos
Message 6 of 9
(3,431 Views)
Maybe only acquire if information is available instead of acquiring at a set rate. Also for deterministic response you should use the "wait until next ms multiple". Hope this helps
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 7 of 9
(3,431 Views)
I hope you're not getting tired by helping me. If so I'm sorry!!!

Here is now the new vi which is just to grab pictures. 'I Don't have Vision' meant that I do not have Imaq Vision Software. To grab pictures I'm using Imaq Pci 1411 board.

Yes, I mean continuous grab - and I could use the wait function, but I wonder if it is normal that it takes 1sec. to take just one true color image.

Hope this helps you to help me.

Starter
0 Kudos
Message 8 of 9
(3,431 Views)
Hello,

I apologize for not recognizing it before, but you would probably be much better assisted by our IMAQ support group. They have a more specialized and specific knowledge of our IMAQ hardware and programming techniques. Please post your question on their DevZone site or submit an email to us at www.ni.com/ask.

Thanks!

Liz Fausak
0 Kudos
Message 9 of 9
(3,431 Views)