annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

event structures and elapsed time

Hi,
 
I am having trouble with the attached VI, which contains an event structure of the three events "start, stop and pause." What I wish to do is have the elapsed time be continually refreshed, displayed on the front panel (perhaps by wrapping it in a while loop?). In addition, I need the start button/case, when pushed/executed, to start the elapsed time and for the stop button/case to reset the elapsed time. The difficulty I ran into when attempting to do this arose when I noticed that with an event structure inside a while loop, LabVIEW seems to ignore any functionality that exists between the boundaries of the while loop and event structure--in other words, the elapsed time is only refreshed during the transition from say, "start" to "pause".
 
I hope once the timing is done, it will be a sound framework for the remainder of the program, which will have serial read/write commands to an external media pump within the different event cases.Thanks!
 
Adam
 
 
0 Kudos
Messaggio 1 di 3
3.794Visualizzazioni
Well, its all in the dataflow. The loop cannot finish the current iteration unless all elements in it have finished. The event structure is waiting for an event, thus the loop does not spin unless an event occurs. 🙂
 
You can use the timeout case to run your timer. Simply use a shift register to keep track of the time and increment it once per second unless pause is pressed.
 
Attached is a simple modification (7.1).
0 Kudos
Messaggio 2 di 3
3.786Visualizzazioni
Wow, thanks a lot Altenbach! Runs like clockwork Smiley Felice
0 Kudos
Messaggio 3 di 3
3.757Visualizzazioni