locked
Run in especified interval RRS feed

  • Question

  • Please consider my project http://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

    Monday, September 17, 2007 7:34 PM

Answers

All replies

  • 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

    Monday, September 17, 2007 9:47 PM
  •  

    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!

     

    Thursday, September 20, 2007 8:42 PM
  • 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

    Thursday, September 20, 2007 9:14 PM