Timer works intermittently or not at all

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I have a simple program that uses two timers. One of them works intermittently and the other not at all.

   

 

   

The first, Tilt_Dn_Timer, will work anywhere from 1 to five times in a row, and may not work the same number of times during the same single program run. I don't understand how this can be, unless, HYPOTHETICALLY, the timer module itself is flaky. I don't know what I could be doing wrong. I think it should either work or not work.

   

 

   

The second timer, the Tl_Saf_Timer, never seems to count down. I don't know why one timer sort of works and the other does not work at all. I believe I configured and control them the same.

   

 

   

Any advice is gratefully appreciated. Thank you.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You shouldn't read the timer value, this will not be zero when the timer has expired because of the reload. Instead use ReadStatus() API and check for timer running.

   

 

   

Bob

View solution in original post

0 Likes
4 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

What do the timers do when you don't have any code do they work correctly? Also I always turn on all components by having a start command.  It is just good practice to do that.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The start() API does a bit more for some components: It energizes them, so that they use power and work as suggested.

   

IMHO using Component_Start() API is a must-do.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I  tried your suggestions by putting Timer_Start both before and after Timer_Enable. There was no change, Tilt_Dn_Timer works as expected. Tl_Saf_Timer does not appear to work at all.

   

 

   

I am grateful for any ideas offered.  Thank you.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You shouldn't read the timer value, this will not be zero when the timer has expired because of the reload. Instead use ReadStatus() API and check for timer running.

   

 

   

Bob

0 Likes