LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display the "timer" current time to user

Solved!
Go to solution

Hi

 

How to display the "timer" current time?

 

Currently i using timer in my program, how to display the current time left on the timer to let user know how much time left on the timer?

 

Is the timer count up or count down?

 

using TimerCB

 

can any one advice?

 

Thanks

ben

 

0 Kudos
Message 1 of 2
(4,378 Views)
Solution
Accepted by chris_chua

I am not aware of a possibility to obtain the time until a timer callback will be called, so I would suggest a different approach:

 

If, say, you want a certain action to happen every 10 minutes but would like to update the UI every second showing the remaining time I would set the timer interval to 1 s. In the timer callback I would use a parameter that will be incremented by one every time the callback is called; if this value reaches 60 x 10 I would reset the parameter and call the function to do the work. In all other cases you would simply need to display 600 - parameter (in seconds) as the remaining time.

 

An alternative could be to use two timers, one for the action, called every 10 minutes, and one for the UI update, called say every second...

0 Kudos
Message 2 of 2
(4,370 Views)