LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to insert (while) loop in video VI

Solved!
Go to solution

Hi all,

 

I'm building a VI to count the fringes of an interferometer using a Thorlabs 1645C video cam (with the UC480 VI). The intention of the VI is to count the times that fringes passes a certain pixel, and to do this, I need a threshold counter. As can be seen in the screenshot, the video array is first reduced to a single pixel (using a cursor) to yield a 256bit integer that indicates the grayscale. This grayscale should trigger a count everytime it passes a certain value, but the threshold detector resets itself every time the grayscale value dips below the threshold. I tried using while loops (and other types loops) but in these cases the video won't play at all, rendering the VI useless. When using other set-ups however, like the one attached,  the count will just keep increasing as long as the grayscale value is above the given threshold, or it won't count at all.

 

After a week and half of trying, I'm out of ideas. Could anyone please help?

0 Kudos
Message 1 of 8
(3,772 Views)
use code is not in correct you have to insert your threshold codes inside loop that capture the image and also you have to use shift register I think
could you tell what you want to do with nterferometer fringes analyse
i work with such fringes and may be could help you about it
0 Kudos
Message 2 of 8
(3,731 Views)

Could you expand that thought? I tried using while loops within the Flat Sequence, I tried connecting the values inside this sequence to a while loop outside the Flat sequence, but using while loops seems to stop the video. To put it differently, no video will play when a while loop is added for use with the counter. I tried replacing the shift register with feedback nodes, but that failed too.

 

Well, I'm using a regular Michelson interferometer in which I put a vacuum chamber in the path of one of the beams. When pumping air from the vacuum chamber fringes will pass, which we can count using a light threshold at a certain pixel. Like this: http://grephysics.net/ans/9277/96

 

0 Kudos
Message 3 of 8
(3,684 Views)

Edit: uploading error

0 Kudos
Message 4 of 8
(3,682 Views)

The fragment of a picture that you showed indicates a lack of understanding of the concept of dataflow, which is the foundation that LabVIEW is built upon.  Without understanding dataflow, effective LabVIEW programming cannot be achieved.  Please go through the tutorials listed on the right side of the main LabVIEW forum page and don't be afraid to ask questions about what you don't understand.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 8
(3,663 Views)

Thanks for the reply Smiley Happy

 

Well, yes, I understand why this VI won't work, but it's the best approximation I can think of without using a while loop and shift registers. I'll look into it, but I've got about 15 iterations, with While Loops inside and outside the structure, Boolean counters, etc., and I haven't been able to find a solution (not in the help function, on forums or in tutorials). Unfortunately, the professor that taught me LabVIEW couldn't help me either.

 

P.s. The screenshot is part of a larger program, but since LabVIEW doesn't support zoomin out, I'm unable to post a comprehensive screenshot.

0 Kudos
Message 6 of 8
(3,645 Views)

@Oi! wrote:

Thanks for the reply Smiley Happy


P.s. The screenshot is part of a larger program, but since LabVIEW doesn't support zoomin out, I'm unable to post a comprehensive screenshot.


Post the actual VI.

 

Or post a VI Snippet.  Though in my opinion, the Code Capture Tool works better than the built in snippet maker.

0 Kudos
Message 7 of 8
(3,635 Views)
Solution
Accepted by topic author Oi!

Next time I have a question I'll post a snippet, but since this VI needs a specific camera to run, I thought that posting the full VI wouldn't be helpful.

 

I think found the solution though! (It seems to be working as far as I can tell)

 

Turns out I needed a Greater? block instead, in which the feedback loop holds a high value for a single 'loop' iteration (which is odd, because I used almost the exact same set-up, but instead of the Threshold Detector VI I used a Boolean, which was without success).

 

I've added a screenshot because it seems more convenient than adding a VI (especially because of compatibility etc.)

 

Thanks to everyone for the feedback Smiley Very Happy

0 Kudos
Message 8 of 8
(3,627 Views)