LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continous loop of selecting a File Image problem

Solved!
Go to solution

Hi. I have a VI here that has a problem. Everytime I execute the program and hit the load image button, it loops infinitely and I can't fix that problem. Can you please help me to modify my code to fix the problem? Thanks.

0 Kudos
Message 1 of 5
(2,989 Views)
Solution
Accepted by topic author nerudorin

Hi nerudorin,

 

your loop iterates UNTIL you press the "Close" button - that's ok for most UI loops.

 

But your buttons are set to "Switch…" mode - you surely want to use a "Latch…" mode instead! All you need to do is change their switching mode behaviour!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,974 Views)

It is better you start using the State machine to simplify the problem.

You could follow below links for the same: 

Tutorial: State Machines:http://www.ni.com/tutorial/7595/en/

Application Design Patterns: State Machines:http://www.ni.com/white-paper/3024/en/

Using a State Machine (Event Driven) Architecture:http://www.ni.com/white-paper/2926/en/

Thanks
uday
Message 3 of 5
(2,969 Views)

Thank you for helping! Now, I tried to run the VI and I can load now images to it. I tried to press the FFT button but there is an error, it requires a complex image so I adjusted the image type to complex. Then, I tried to press it again, it works. Now, when it comes to inverse FFT, it also requires a complex image source. I changed the image type but there's still an error. Why is that so? Thank you.

0 Kudos
Message 4 of 5
(2,953 Views)

I'm worried that you are using Powerful Techniques (like FFTs, EEGs, etc.) for which tools exist in LabVIEW, but you neither have the basic LabVIEW skills necessary to create code using LabVIEW, but you also may not have an understanding of the kind of signal processing that is required to accomplish a particular task.

 

If you are going to use the LabVIEW Image Processing Tools to do anything more sophisticated than saving images, then you need a body of knowledge about how to work with images, including acquiring them, modifying them, processing them, and, if you are doing anything with color, there's a whole other set of somewhat complex basic knowledge you will need.

 

Do you know what it is that you want to do?  Do you know algorithms that will allow you to do this?

 

I'm a great believer in "learn by experimenting with the code".  This works very well when the data are simple, like a string (for example, parsing string data) or numeric data (for example, creating a multi-channel scrolling graph from sampled data).  However, when working with Image data, the basic data structure is so much more complicated (two spatial dimensions + an intensity/color dimension), and, to make things more complicated, there are fewer tutorials and text material available.

 

Do you have something specific that you would like to do?  Can you describe what that is, from a "high level" (that is, independent of the implementation, i.e. without mentioning LabVIEW, and, perhaps, without mentioning FFTs)?  

 

Bob Schor

0 Kudos
Message 5 of 5
(2,932 Views)