Hi guys,
I have a Little problem.
A timer inside a program stop, reset but not start.
Dome idea?
Hi guys,
I have a Little problem.
A timer inside a program stop, reset but not start.
Dome idea?
Are you sure that your command TIMER_START executed after TIMER_STOP?
Yes.
Stop
Reset
Start.
No One.?
Share part of code. It's difficult to say. Most likely something wrong with code.
Did you try to make dummy program and start/stop/reset timer?
TIMER[3]=STOP ;
TIMER[3]=RESET ;
TIMER[3]=START ;
R[2]=TIMER[3] ;
if TIMER[3]>10, jmp lbl[100];
TIMER[3]=STOP ; <- N time
TIMER[3]=RESET ; <- 0 time
TIMER[3]=START ; <- 0 time
R[2]=TIMER[3] ; <- take 0 time and copy to R[2]
if TIMER[3]>10, jmp lbl[100]; <- never happen
Cool. Look explanation of your time value above. Timer start, as I see you are expecting to get data into R[2]. But as you can see you are doing next:
start timer#3
immediately receive time count into R[2]
and expect to jump by link. What you have in your R[2]? Most likely value between 0 and 8. Based on processor load.
FIY: you are not linking your timer count into register, you just taking current count and copy to register. if you are getting 0 in R[2] all the time, then try to add WAIT 1 sec before R[2] = TIMER[3]. Then you will see result and feel how timer works.
Cool. Look explanation of your time value above. Timer start, as I see you are expecting to get data into R[2]. But as you can see you are doing next:
start timer#3
immediately receive time count into R[2]
and expect to jump by link. What you have in your R[2]? Most likely value between 0 and 8. Based on processor load.
FIY: you are not linking your timer count into register, you just taking current count and copy to register. if you are getting 0 in R[2] all the time, then try to add WAIT 1 sec before R[2] = TIMER[3]. Then you will see result and feel how timer works.
Thanks thanks and so thanks.
In fact now works. Show 1. But if I need to show milliseconds? I use this timer to check tool open and close to check if is closed or opened right.
In case if you are using some sensor to detect tool opened and toil closed position, the. You can fo next:
Start timer
Open tool
Reset timer
Wait for sensor triggering
Save timer value into register
Stop timer