Author |
|
pingmustard Newbie
Joined: September 13 2010
Online Status: Offline Posts: 18
|
Posted: January 06 2013 at 02:29 | IP Logged
|
|
|
I'm trying to create some lighting control logic based on global variable state changes. However, I notice when triggers fire, I can't really condition the trigger on a previous state value. Is there a way to create trigger to capture when a global variable change from value A -> value B (not just any change)?
If a trigger is configured on modification of a global variable GV_SAMPLE, and a condition of "{GV_SAMPLE}=1" is used as the trigger Boolean, does the condition always evaluate BEFORE the global variable GV_SAMPLE is changed?
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: January 06 2013 at 08:51 | IP Logged
|
|
|
I think you would need to add a variable to track the previous state.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: January 06 2013 at 13:31 | IP Logged
|
|
|
Actually, [TEMP5] contains the new value and [TEMP10]
contains the previous value. So you could use this in
the boolean field to trigger only on specific values.
If you want to trigger ONLY when a GV changes from value
A to value B, then you could use this in the boolean
formula:
ph_getvar_s(2,10) = "A" and ph_getvar_s(2,5) = "B"
Hope this helps,
Dave.
|
Back to Top |
|
|
pingmustard Newbie
Joined: September 13 2010
Online Status: Offline Posts: 18
|
Posted: January 14 2013 at 00:49 | IP Logged
|
|
|
That seem to have done the job.
Thanks Dave!
|
Back to Top |
|
|