Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

start acqusition button

Solved!
Go to solution

Hello I am using Vision development module of Labview to control a high speed camera for my project. In my project I have to capture images as in continuous video like , convert the images into binary images and than calculate number of particles in that image (pixel measurement) doing particle analysis. I am attaching my VI for a better understanding. Now my VI is working fine but with some lags.So to over come this lag I made some changes. Previously my image acquisition and processing both were taking place in one while loop so I seperated acqusition and processing into two different while loops.But now the problem is that I can only continuosly acquire the images and VI doesnot proceed to the second whileloop of image processing. My question is can I put some sort of "Start" button in the first while loop so that when I press that button the my image analysis of second loop stars. If yes than How.

 

Thank you.

0 Kudos
Message 1 of 5
(5,037 Views)

Hello,

 

think "dataflow". Your second loop won't start until the image reference is passed to it (the purple line). So when, the first loop stops, only then the bottom one can start.

 

Use local variables to pass data between loops (or use queue).

 

See this link (download the .llb file and take a look at different methods):

 

https://forums.ni.com/t5/Example-Code/Using-Local-Variables-Queues-and-Notifiers-to-Synchronize-Data...

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 5
(5,034 Views)

Hello K,

 

I added the Que function in my VI . Now both the loops are working but in the second loop I donot get graph construction graph of my result. I am attaching the New VI for your reference.

 

Thank You.

0 Kudos
Message 3 of 5
(5,028 Views)
Solution
Accepted by Arshad17

I suggest first you try running your program by using a simple local variable (I think this method should be sufficient for your application):

 

create image display indicator on the front panel, connect it to your function (image output) and right click -> create -> local variable (if you don't want the image indicator to show on the front panel, you can hide it).

 

Pass this created local variable to the processing loop. Allocate new memory for the image in the processing loop ("Image Dst", Local Threshold).

Also, synchronize the loops using the timing functions (shown in the example link in the previous post). In my experience it is always good to implement some delay in your while loop (this should give the processor some breathing time...).

 

You need only ONE button to stop both loops...

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 4 of 5
(5,020 Views)

Hello K,

 

The VI is now working just fine. Thank you for your help !!

0 Kudos
Message 5 of 5
(4,993 Views)