LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulataneous While Loop Processing

Hi,
 
I have an application that is based on an Event Structure. When a start button is pressed an even is triggered (START Button) that contains a while loop. The while loop runs a test for a specified time. Whilst this loop is running all other functionality within the application is disabled. I need to be able to click on other tabs and trigger other events whilst this loop within the event structure is running.
 
I think I need to be running parallel loops or something but I dont see how I can do that and still have the event triggering functionality.
 
I have attached my working vi in hope that it highlights what I mean. Any advice would be gratefully received 🙂
 
Liz
0 Kudos
Message 1 of 3
(2,552 Views)
Put your start test event and while loop in a separate event structure.
 
Another option would be to have your start event drop a notifier into a separate waiting loop to start the test.
 
 
In either case, your program freezes because you probably have "Lock front panel until this event completes" checked.


Message Edited by JeffOverton on 06-16-2008 11:43 AM
0 Kudos
Message 2 of 3
(2,546 Views)
You have about 90% too much code!
  • Does it really take 2 "delete from array" followed by "index array" to simulate an "array subset"???
  • In the "load" event, you have two consecutive loops, the first creating an array of indices that you then autoindex out in the next loop and throw away later. I guess one loop would be enough, simply wiring to [i]. 😉
  • You are not using any terminals, but only value property nodes.
  • You are constanty growing and shrinking arrays in shift registers.
 
It is a very bad idea in general to trap code in a while loop inside an event structure.
 
First of all, don't use "lock front panel until event completes", but the overall problem is much deeper. You could probably use the outer loop and the timeout event for the "start" part. See e.g. http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=224817#M224817
 
0 Kudos
Message 3 of 3
(2,537 Views)