| View previous topic :: View next topic |
| Author |
Message |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Tue Feb 01, 2005 3:03 pm Post subject: Timer problem (random stop) |
|
|
I dont know why the timer just stop itself.
Example:
System shutdown preset with 30 minutes in seconds so a delay is made on current time
Problem:
Countdown timer randomly stops
I recently upgrade system with newer graphics card and better PSU (power) the cpu is the same
AMD 1700+
768 DDR
FX 5600
PSU 350W |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Feb 02, 2005 1:01 am Post subject: |
|
|
filip,
showing the code part of how you use the timer will help folks help you
serge _________________
|
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Wed Feb 02, 2005 6:22 am Post subject: |
|
|
Here you go...
:loop
wait event,0
goto @event()
:Half hourMENU
%K = 1800
%b = %T
Dialog disable,Time
Dialog disable,BUTTON1
Dialog set,Time2, 30 minutes
goto loop
:Evloop
wait event,0
goto @event()
:Timer
%t = @datetime(hh:nn)
dialog set,time,%T
IF @Equal(%T,%B)
goto newloop
end
:newloop
%E = @event()
%k = @pred(%K)
dialog set,status1,Shutdown in %K s...
wait event,1
if @equal(%E,BUTTON2)
stop
run sysoff.exe
exit
end
if @equal(%K,0)
runh Shutdown.exe -s -t 00
end
goto evloop |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Feb 02, 2005 1:15 pm Post subject: |
|
|
your problem seems to be in the part of the code
| Code: | IF @Equal(%T,%B)
goto newloop
end |
because it will stop your timer once the current time is ahead by 1 minute compared to the time you have set
in other words, your timer will count down as long as the current time is the same as the time set, but once it goes on to the next minute, then your IF condition is no longer met
hope i explained it right
serge _________________
|
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Wed Feb 02, 2005 6:13 pm Post subject: |
|
|
yes
i use very poor timer
i never look the timer.dsc sample
where to put: timer stop,%T or mybe timer stop,1
Thanks anyway |
|
| Back to top |
|
 |
DavidR Contributor

Joined: 05 Aug 2003 Posts: 83 Location: Bethel Pennsylvania U.S.A.
|
Posted: Fri Feb 04, 2005 11:55 am Post subject: Timer frustration |
|
|
I've given up on using the VDS TIMER function.
I've spent hours trying to get this to work reliably without success.
I would preload the timer with a value and on the next timer read would get the timers previous value instead of the value I loaded. Also trying to restart a timer with less than 1 second left would sometimes fail. I tried numerous work-arounds but finally gave up.
Now I grab the system time when starting a timer - like this:
| Code: | | %%TEMP2 = @SUBSTR(@DATETIME(),7,15) |
and compare with offsets to create my own timers.
This has worked flawlessly!
I'm not discounting the possibility that I'm doing something wrong with the VDS TIMER but I can only struggle for so long, then I look for another solution.
...........David |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Fri Feb 04, 2005 2:03 pm Post subject: |
|
|
from script was removed ?
IF @greater(%T,%A)
goto newloop
end
With this code works but i get minus values of %K |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sat Feb 05, 2005 1:02 am Post subject: |
|
|
i need to point out that there are 2 timers in vds, in very general terms,
1. there is the label :TIMER which filip is using,
2. there is the TIMER command and the @TIMER() function, which i assume David is talking about. I have had problems with TIMER and @TIMER() but once i understood how it reported the timer values, i have not had any problems.
Note that 1. and 2. are not the same
serge _________________
|
|
| Back to top |
|
 |
DavidR Contributor

Joined: 05 Aug 2003 Posts: 83 Location: Bethel Pennsylvania U.S.A.
|
Posted: Mon Feb 07, 2005 12:46 pm Post subject: |
|
|
| Quote: | i need to point out that there are 2 timers in vds, in very general terms,
1. there is the label :TIMER which filip is using,
2. there is the TIMER command and the @TIMER() function, which i assume David is talking about. I have had problems with TIMER and @TIMER() but once i understood how it reported the timer values, i have not had any problems.
Note that 1. and 2. are not the same
|
You are exactly correct Serge. I wasn't paying close enough attention when I read his post.
My problems with the TIMER command were in the "sub-second" range and probably was not what the timer was originally intended for.
The beauty of VDS is that there's almost always some other way available to achieve the desired results.
..............David |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Feb 07, 2005 2:07 pm Post subject: |
|
|
no sweat
| Quote: | | The beauty of VDS is that there's almost always some other way available to achieve the desired results. |
i so agree with you
serge _________________
|
|
| Back to top |
|
 |
|