LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

timer (seconds or minutes)

Hi, I need some advice on the TIMER function. If I need a ONE minute interval, what factor must I mutiply to the factor in order to achieve that? The interval comes from an external input, i.e. it can change from ONE minute to maybe 5 minutes.

Thanks.
0 Kudos
Message 1 of 4
(3,210 Views)
I don't understand which 'factor' are you talking about.
Timer() is a function that returns the amount of seconds since the program started execution, so in order to achieve a some-minute interval you must:
1. save the initial Timer() value in a double variable
2.check at intervals the value returned by Timer()
The desired interval has expired when (initial-value - Timer()) gives a result greater than some-minute * 60.

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,210 Views)
Instead of the Timer() function, why not use a Timer control on your panel, and its corresponding callback? Then you can change the timer interval at any intervals you want, and call your other functions from inside that callback.
0 Kudos
Message 3 of 4
(3,210 Views)
"Craig Leidholm" ha scritto nel messaggio
news:5065000000050000006C540000-1007855737000@exchange.ni.com...
> Instead of the Timer() function, why not use a Timer control on your
> panel, and its corresponding callback? Then you can change the timer
> interval at any intervals you want, and call your other functions from
> inside that callback.


I agree with Craig: you can use setctrlattribute to set Timer interval with
a value calculated at run-time...
0 Kudos
Message 4 of 4
(3,210 Views)