Variable won't set


#1

1) Give a description of the problem
My variable inactive will not set to false. Why will it not change. The light comes on as expected.

2) What is the expected behavior?
The light comes on and inactive is set to false.

3) What is happening/not happening?
the inactive variable is stuck true even though it is a dynamic variable.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

The problem is you are assigning the variables within the definitions, which means the definitions will reset back to the defined value every time the piston runs. So they start as defined, update when the trigger to turn the lights on is satisfied…then when your off trigger sets, the variables reset again.

What you need to do instead is defined them with no value. Then have them updated in the two triggers.

Now, the unintended consequence, and there always is one, is your pistons may not run with the variables initially undefined. So I usually include a switch operation in there to set the initial variables by manually turning the lights on or off. You could also do this within the ST app.