06-18-2012 07:27 AM
HI
I want to display a stopwatch on the FP (to measure the time and display it when needed) but while the stopwatch is running still react to the other controls on UI
How can I do it?
I have tried something (Attached) but while the StopWatch is running the Knob is Ignored
Is there a better why of doing it?
Thanks in Advance
AA
06-18-2012 08:17 AM
The stop watch will have to be in its own loop to do this or you will have to make it so that the stop watch only executes once and then comes out of the code. You can not have a loop inside of a loop and expect to get the kind of execution that you are asking for.
06-19-2012 02:54 AM
Hi
Can someone Maybe suggest A better way to achieve it?
Thanks
AA
06-19-2012 03:14 AM
Did you bother to try aeastet's solution?
He's absolutely right - you need to put the stopwatch execution in a separate loop which runs independantly of your main program loop.
If you mean can someone code it for you, then you are going to be dissapointed. People on these forums will give fantastic and very patient advise (in my experience), but you are expected to put in the effort on the recieving end. We're not a free code writing service!
-CC
06-19-2012 08:02 AM
HI
I have tried his solution but putting another loop with an event structure will lock my front panel while waiting for start stopwatch event
and that is my problem I have asked if anyone has a good solution for?
And no I don't need anyone coding for me just explaining would be enough
THANKS
AA
06-19-2012 09:13 AM
Glad we're singing from the same hymn sheet!
Do you mean that you've got two event structures running in your program? That's not a good idea.
If you want to control the stopwatch loop from the front panel then you could use a notifier from your single (main) event structure.
-CC
06-19-2012 10:36 AM
If the code that you posted is suppost to be two seperate loops then you really do not understand how LabVIEW works. You have the stopwatch loop inside the other loop. That is not OK and it will do what you are saying that it does. You need to move the stop watch outside the main loop for this to work properly. If I get a chance later I will try to help you out with an example. Otherwise you need to know right now what you are doing is not two different loops.