LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying a stop watch while waiting for UI events

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

 


Download All
0 Kudos
Message 1 of 7
(2,905 Views)

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.

Tim
GHSP
0 Kudos
Message 2 of 7
(2,888 Views)

Hi

 

Can someone Maybe suggest A better way to achieve it?

 

Thanks

 

AA

0 Kudos
Message 3 of 7
(2,866 Views)

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! Smiley Wink 

 

-CC 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 4 of 7
(2,862 Views)

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 enoughSmiley Wink

 

THANKS

 

AA

0 Kudos
Message 5 of 7
(2,844 Views)

Glad we're singing from the same hymn sheet!Smiley Very Happy

 

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

 

 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 6 of 7
(2,830 Views)

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.

Tim
GHSP
0 Kudos
Message 7 of 7
(2,817 Views)