Problem with delayed events and cancelling them

Avatar
Robdon
204 Posts
Posted Jun 22, 2011
Hi,

I have a Laser Relay that has a Output on 'Powered' to start animating an arm to the up position. It also has a Output on 'UnPowered' that then lowers it.

All works well, but if you add a delay to the 'Powered' Output of say 5 seconds, then if you move the laser away from the relay while its in this 5 second delay, then it immediately triggers the 'UnPowered', which is fine, but the 'Powered' event is still running, and then runs in a few seconds when the delay runs out. So the arm is in the up position even though the relay isnt powered.

Am I doing something wrong?

Or is there some Output that I cant find that 'cancels' all delayed events, so I can call that first on UnPowered, before animating the arm to down?

The reason I have a delay, is that I have lots of panels to move to up, and I put a .20 delay in each one so they look 'different'.

Thanks,

Rob.

Advertisement
Registered users don’t see ads! Register now!
Avatar
kwp21 pitts
260 Posts
Posted Jun 22, 2011
Replied 37 minutes later
Use the CancelPending command on the logic_relay that is to be halted
Avatar
Will T.
163 Posts
Posted Jun 22, 2011
Replied 4 minutes later
The output you want is "CancelPending."

It sounds like you're controlling everything from the laser relay directly. Use two logic_relays to control your up/down motions, one for up and one for down, with the up one triggered by OnPowered and the down one by OnUnpowered from the laser relay. Give each one the CancelPending output directed at the opposite relay (so the up one fires CancelPending at the down one), activated OnTrigger.

EDIT: Ninja'd ... drat.

Avatar
kwp21 pitts
260 Posts
Posted Jun 22, 2011
Replied 5 minutes later

Will T. wrote:
EDIT: Ninja'd ... drat.

Oh well, At least you have brought in more insight.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Robdon
204 Posts
Posted Jun 22, 2011
Replied 2 hours later
Hi guys,

Thanks a ton for that... worked like a charm, just what I needed :smile:

I was doing all the work in the Laser Relay directly, now I have 2 Logic Relays and its fine.

Rob.