03-08-2016 09:37 AM - edited 03-08-2016 09:39 AM
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?
Solved! Go to Solution.
03-08-2016 10:41 AM
03-09-2016 08:52 AM
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
03-09-2016 08:52 AM - edited 03-09-2016 08:53 AM
Edit: uploading error
03-09-2016 09:22 AM
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. 🙂
03-09-2016 10:19 AM
Thanks for the reply
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.
03-09-2016 10:49 AM
@Oi! wrote:Thanks for the reply
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.
03-09-2016 12:41 PM - edited 03-09-2016 12:42 PM
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