LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"IMAQ Stop" takes 10sec to execute and consumes 100% CPU

Solved!
Go to solution

Hi, I'm calling IMAQ Stop to end an acquisition but it consumes 100% of my processor and takes 10sec to complete (all the while consuming 100% CPU).  In our application we start and stop the camera regularly and this is exactly when the user wants the program to be interactive so this 10sec delay is a big irritation to them.

 

My setup is - Dalsa Piranha line scan camera, RT 9 running on a desktop PC  (it is compatible according to the test), PCI-1429 cameralink card.

 

Any help or comments welcome.

 

Thanks.

0 Kudos
Message 1 of 7
(3,487 Views)
Can you post a screen shot of your vi?
0 Kudos
Message 2 of 7
(3,474 Views)

Here is a similar code sequence that exhibits the same behaviour.  A frame consists of 250 lines and the frame rate is 25fps.

CamExample.PNG

0 Kudos
Message 3 of 7
(3,465 Views)

Hello,

 

Is it not your image processing code that cost 10s of CPU ?

 

if yes the way is to write image process in more segmentable parts (if possible)

 

what happens if you test code without image Stuff ?

 

 

Regards

 

Tinnitus

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 4 of 7
(3,461 Views)
No the image stuff takes approx 12ms.  It is when I specifically time the IMAQ Stop when I measure the 10sec delay.
0 Kudos
Message 5 of 7
(3,452 Views)

Hey Anthon,

 

How are you measuring the time it takes for the IMAQ Stop.vi? In your screen shot, there is no indication that you are explicitly measuring the time it takes for the IMAQ Stop.vi to execute.

 

Also, what happens if you remove the IMAQ Stop.VI and just use the IMAQ Close.vi? This would still be a valid way of terminating your IMAQ session as the IMAQ Close.vi "Stops the acquisition if one is in progress, releases resources associated with the acquisition, and closes the specified IMAQ session." I would be curious to see if only using the IMAQ Close.vi eliminates or reduces this delay that you are seeing.

 

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 6 of 7
(3,438 Views)
Solution
Accepted by topic author AnthonV

Ah I have managed to solve this one, but first here are the answers to your questions:

Using Stop and then Close or just Close makes no difference.  The Stop was taking so long that I simply used a probe before and after it on the error cluster and with 2009's probe timestamp function I could easily see how long it took.  For more detailed timing analysis I use the us timer available with RT.

 

In any case, the way I solved the problem was by making sure that I stop the acquisition BEFORE the line clock to the camera is stopped.  So IMAQ Stop probably waits for the end of the current frame before it returns - and if the line clock stops halfway through a frame (as was the case), a 10 sec timeout probably causes Stop to return eventually. 

 

The line clock is being driven by a DAQ card (via RTSI) and I simply closed the session to that counter AFTER calling IMAQ Stop.  The DAQ interface is not shown in the example above as it is coded in a different vi.

 

Thanks for all the help. 

0 Kudos
Message 7 of 7
(3,419 Views)