1) Give a description of the problem
In several of my applications I have found the WAIT Instruction to be problematic. With the Forum’s help, a workaround was usually found. I thought that the misbehavior of the WAIT was limited to being interrupted by any other calls made to the same piston while execution.
These two pistons demonstrate that the WAIT can disrupt other executing instruction. To my mind, this is dramatically troubling. Is there a set of rules by which the WAIT can be used safely?
2) What is the expected behaviour?
The piston and its expected behavior are very trivial. It is triggered, it then executes several Set Variable instructions in a row, and if successful it turns on a lamp (Piston Example #1)
3) What is happening/not happening?
(Piston Example #2) Taking the above piston and putting WAIT instructions between each of the Set Variable instructions causes the code to fail by disrupting other Set Variable instructions. This happens when the delay is set to 2000 milliseconds, however, it doesn’t fail at 1000 msec. I have not tested other delays to see if a different type of disruption might occur.
4) Post a Green Snapshot of the piston
5) Attach logs after turning logging level to Full
9/13/2019, 9:58:03 AM +66ms
+0ms ╔Received event [Home].time = 1568383082958 with a delay of 107ms
+92ms ║RunTime Analysis CS > 27ms > PS > 50ms > PE > 16ms > CE
+95ms ║Runtime (40240 bytes) successfully initialized in 50ms (v0.3.10f.20190822) (94ms)
+96ms ║╔Execution stage started
+110ms ║║Calculating (integer) 10 - (integer) 2 >> (integer) 8
+113ms ║║Executed virtual command setVariable (1ms)
+118ms ║║Comparison (integer) 8 is_equal_to (integer) 7 = false (1ms)
+120ms ║║Condition #8 evaluated false (4ms)
+121ms ║║Condition group #7 evaluated false (state did not change) (5ms)
+123ms ║╚Execution stage complete. (28ms)
+124ms ╚Event processed successfully (125ms)
9/13/2019, 9:57:52 AM +795ms
+1ms ╔Received event [Desk Chair].contact = open with a delay of 120ms
+85ms ║RunTime Analysis CS > 21ms > PS > 49ms > PE > 15ms > CE
+88ms ║Runtime (40247 bytes) successfully initialized in 49ms (v0.3.10f.20190822) (86ms)
+89ms ║╔Execution stage started
+96ms ║║Comparison (enum) open changes_away_from (string) closed = true (1ms)
+98ms ║║Cancelling condition #2’s schedules…
+98ms ║║Condition #2 evaluated true (5ms)
+99ms ║║Cancelling condition #1’s schedules…
+100ms ║║Condition group #1 evaluated true (state changed) (7ms)
+102ms ║║Cancelling statement #3’s schedules…
+106ms ║║Executed virtual command setVariable (0ms)
+111ms ║║Executed virtual command wait (0ms)
+112ms ║║Waiting for 2000ms
+2117ms ║║Calculating (integer) 0 + (integer) 5 >> (integer) 5
+2120ms ║║Executed virtual command setVariable (1ms)
+2124ms ║║Executed virtual command wait (1ms)
+2125ms ║║Waiting for 2000ms
+4130ms ║║Calculating (integer) 5 + (integer) 1 >> (integer) 6
+4133ms ║║Executed virtual command setVariable (1ms)
+4137ms ║║Executed virtual command wait (1ms)
+4138ms ║║Waiting for 2000ms
+6144ms ║║Calculating (integer) 6 + (integer) 1 >> (integer) 7
+6147ms ║║Executed virtual command setVariable (1ms)
+6152ms ║║Executed virtual command wait (1ms)
+6153ms ║║Waiting for 2000ms
+8157ms ║║Executed virtual command setVariable (1ms)
+8161ms ║║Executed virtual command wait (0ms)
+8163ms ║║Requesting a wake up for Fri, Sep 13 2019 @ 9:58:02 AM EDT (in 2.0s)
+8167ms ║╚Execution stage complete. (8078ms)
+8168ms ║Setting up scheduled job for Fri, Sep 13 2019 @ 9:58:02 AM EDT (in 1.996s)
+8176ms ╚Event processed successfully (8176ms)
indent preformatted text by 4 spaces
REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.