LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

replacing an event structure with a case?

The atttached program doesn't run. It's waiting on the event structure.(Right?) How do I eliminate the event structure and change number 5 only when a new string is entered?

Thanks
0 Kudos
Message 1 of 8
(3,918 Views)
Wire a timeout value to your event structure and create an empty event for Application->Timeout.  This way, if the string change event doesn't fire in your specified time, then the event structure doesn't do anything and allows your loop to run.  I wired a 100ms delay, and the program seems to run OK.
Message 2 of 8
(3,911 Views)
Sure it does run. It does exactly what you told it to do. You just forgot to add a timeout and wire that selector. See attached (if it works).
Download All
Message 3 of 8
(3,909 Views)
Thanks guys.
0 Kudos
Message 4 of 8
(3,898 Views)
Okay so now I have an on going process in the event structure. I still need to be able to run the case statement. Do I replace the event structure with something else. Or is there some way to tell the event structure to let other things happen at the same time?

Thanks
0 Kudos
Message 5 of 8
(3,869 Views)

It would be much better if you put the event structure in it's own while loop. Add a value change event for the stop button and wire the 'new value' to the conditional terminal. You also want to edit the string value change event to not lock the front panel until the event finishes.

Message Edited by Dennis Knutson on 10-12-2007 10:02 AM

Message 6 of 8
(3,865 Views)
Thanks. One more ste up the LabView learning curve. I tried the vi without the 10 msec wait in the while loop. Of, course, it didn't work, otherwise you wouldn't have put it there. Why is it needed?
Thanks again.
0 Kudos
Message 7 of 8
(3,843 Views)
You need a wait to allow the OS to process other events. In this case, you want to be able to process the user interface. The dealy of 10msec I used was a typo. A wait of 100 msec would be more typical.
Message 8 of 8
(3,839 Views)