Pause in an Elk then clause?

PlanoMike

Member
Pardon for such a simple question, but what is the best way to insert a delay between commands in the then clause of an Elk rule?

The only way I can think of is to have it "speak silence" for a brief period, but that seems quite a kludge.

TIA

Mike
 
The 'best' way is to turn on an output for x seconds, but the problem is I'm not sure if the processing will stop while that line executes instead of just starting the timer then continuing on.
 
The ELK M1 Rule Engine is an event driven engine that executes a Rule when the WHENEVER and AND statements are true.

If you want to delay between Then statements, use a Then statement to turn on an unused output for X seconds. Use another Whenever the Output turns Off to trigger the next Then statement.

There is no processing delay between the Then statements when a Rule fires and executes. You have to make a timer with an output.

The architecture of the M1's Rule Engine makes the Whenever statements fire very quickly. There is no processing from 1st Rule to Last.
 
Ok, thats what I thought and just tested it. So, assuming your logic is...

Whenever A happens
then do 1
wait 10 seconds
then do 2

you would do this in 2 rules like:

WHENEVER A
THEN 1
THEN TURN Output x ON for 10 SECONDS, RESTART IF RUNNING

WHENEVER Output X TURNS OFF
THEN do 2
 
Thsi is a controller and follows the PLC programming paradigm. Its completely different than what you learned in your GW-Basic classes. :lol:

Every statement is evaluated and launched only is proved true.
 
Back
Top