LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop, event structure & stop vi

I've been trying to get this simple vi to work. Basically what I want to achieve is (step wise):
1. first load a file
2. process the loaded file according to the selection (case structure selection within a while loop). I want to be able to change the selection at anytime before pressing OK(stopping the while loop) to confirm the selection and end the loop.
3. for each processes, I am using an while loop>event structure.
Overall what I have is: while >case_structure:2cases >while >event_structure
Also I want to be able to stop the vi at any point of time while it is executing.

The problem is that the vi will not function after pressing the OK button to stop the while loop.

Attach is the vi. Any suggestion is welcomed.
0 Kudos
Message 1 of 6
(2,986 Views)
Your VI did not get attached. If you Review your post after attaching a file, the web site may lose the attachment.

I suspect from your description that the problem is the two loops run sequentially rather than in parallel. It seems that the program will end when the loop with the OK button stops when the button is pressed.

Lynn
0 Kudos
Message 2 of 6
(2,977 Views)
thanks for informing me about the attachment. It's attach to this post hopefuly.
0 Kudos
Message 3 of 6
(2,974 Views)
Hi Joshmonkey,

Your VI is basically incomprehensible. It seems to me that you are trying to do this way too complicated. LabVIEW is easy!

- Use one big while loop containing one (and ONLY one!!!) event structure. Create an event case for all desired user events, including one for the stop button. Use shift registers for data that needs to be available in multiple event cases.


Currently, there are too many missing items and contradictions on your diagram to make a reasonable example. e.g. why is there an "Image interval (ms)" outside the loops?
0 Kudos
Message 4 of 6
(2,970 Views)
lol, you're right. After some revision I was able to make it simpler and I got what I wanted. I think basically what I did at the beginning was very messy due to inexperience usage of many of the functions/vis like the event structure. I'll have to do lots of trial and error to learn more. Thanks
0 Kudos
Message 5 of 6
(2,960 Views)
The LabVIEW learning curve has a steep, but short incline that needs to be overcome. (Many times there is a preconception that "it cannot possibly be that easy", especially with a background in conventional programming ;)). You'll get the "hang of it" pretty quickly and from then on it's all pure fun! Good luck!
0 Kudos
Message 6 of 6
(2,950 Views)