Canceling pending timer

Forum for questions about the SmartRelay Controller. This forum is monitored and questions are answered by 6bit Inc. staff.

Moderator: Staff

Canceling pending timer

Postby Rahul Karnik on January 1st, 2010, 11:12 am

Happy New Year and good to know the forums board is back up so I can post further questions here rather than via email.

This is the same ship anti-heeling-system I've just re-started working on after a long break.
I'm using the SmartSerial board as-is without any changed firmware, using a different micro to trigger the inputs of the SmartSerial board for the most part.

But I had a couple of question about timer events.

What command(s) do you send to cancel a timer that has already been initiated?

Suppose I send :
5t1300

But meanwhile the conditions change dictating that 5R shouldn't be turned on

I've tried multiple 5R0 commands but it the time keeps ticking and eventually works

I've even tried pre-emptingquickly turning it on and then off with successive:
5T10
5R0

On a similar note, how many timer commands can be kept being sent to the board one after the other before overflowing or filling up any internal buffer? The reason I ask is that I kind of kept sending multiple 5T0... commands thinking it would overwrite my pending 5T1 but it appeared that the board had no problem keeping track of my original 5T1300!!
Rahul Karnik
 
Posts: 1
Joined: December 31st, 2009, 10:40 am

Re: Canceling pending timer

Postby Josh on January 23rd, 2010, 2:35 pm

Rahul,

Sorry about the delay, our forum is supposed to notify us of new posts... obviously that didn't happen. But I shall still answer your question.

Like with all commands that you send to the board the timer command is echoed back as a signal of success. The timer command however also returns an additional piece of data in this echo, when you send `5T1300` it will respond `5T1300|1`. The number after the | (pipe) is the ID of the timer that is tracking this timeout.

The timer ID can be used with the `T` command to cancel the pending timeout, sending `T1` would cancel a pending timer with the ID of 1. Sending the `T` command alone with no parameters will simply clear ALL pending timers.

In the current firmware the number of timers is 12, but this may increase as we use processors with additional memory. To let you know that you are out of timers the board will respond with an error signal (a question mark `?`) if a timed command is received when there are no free timers.

Josh
6bit Inc.
Josh
 
Posts: 37
Joined: January 6th, 2005, 1:00 am


Return to SmartRelay Controller Support

Who is online

Users browsing this forum: No registered users and 2 guests