How to create a timer event?

Hello!
How can I create a timer event?

The task is as:

  1. Start the timer (5 s, for example, the time changes every iteration).

  2. Do something (it is known that it takes less than 5 s, but how much is unknown exactly).

  3. Still wait until the time runs out.

  4. Do something.

Read up on ITmer interrupt in the rapid instruction manual.

I think I’ve done something similar using PulseDO and WaitDO.

PulseDO \PLength:=5.0, doMove001;

MoveL Move001, bla, bla;

WaitDO doMove001, 0;

PulseDO \PLength:=5.0, doMove002;

MoveL Move002, bla, bla;

WaitDO doMove002, 0;

PulseDO \PLength:=5.0, doMove003;

MoveL Move003, bla, bla;

WaitDO doMove003, 0;

@Soup I would make sure to use the optional argument \High to avoid getting into a catastrophe if the signal were on already for some reason. But that is an interesting implementation.

@lemster68 Good point, could also do a SetDO to 0 before the pulse to make sure it goes low.