Run in especified interval

Please consider my projecthttp://tnt.drivehq.com/SenonTupa.zip


I need to run a function in a especified interval. Like an interrupt. At every 60000 ms run a function.

Can I activate a listener that listen the clock, or something like? How can I do this?


Thanks

[393 byte] By [T.N.T.] at [2008-1-9]
# 1

Service tutorial 2 [1] shows how to use the TimeoutPort to acheive exactly what you are looking for.

Hope this helps,

Andreas

[1] http://msdn2.microsoft.com/en-us/library/bb483062.aspx

AndreasUlbrich at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Decentralized Software Services (DSS)...
# 2

Thanks a lot for your reply, you gave me a ideia:
Call a parallel function with a infinite loop. In the infinite loop call a timer (with TimeOutPort) and the code I want to execute.
This works!

T.N.T. at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Decentralized Software Services (DSS)...
# 3

Can you be more specific on what you want to do? You do not need an infinite loop. In fact, it is a bad idea because the infinite loop locks up on thread that then can't be used for anything else.

The tutorial has a periodic timer that works as follows.

- activate a oneshot timer handler on the timeoutport

- in the timer handler: do what needs to be done periodically, reactivate the time timer handler

Andreas

AndreasUlbrich at 2007-10-3 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Decentralized Software Services (DSS)...

Microsoft Robotics Studio

Site Classified