In Tag Alarms-Enable Binding:
If I bind it to one Tag, when tag change ,the Enabled value will Synchronous change. It's right.
But,if I bind it to Expression, when tag change ,the Enabled value will not Synchronous change. I must restart Tag. If I changed this Tag again, it not Synchronous change?
==
syntax is Python. Expression Language does not use Python.
Reduce your expression to,
!{[.]../SensorPara/high_warning_enable}
which will return the NOT of the tag. (Note the '!'
at the start of the expression.)
Tip: add some "air" into your coding.
if({[.]../SensorPara/high_warning_enable}=false,true,false)
is much easier to read when spaces are added after punctuation and to separate keywords (same as in English).
if({[.]../SensorPara/high_warning_enable} = false, true, false)
Keep in mind that alarm bindings only execute when the alarm has an event. So you should expect your enable/disable changes to happen late.
The reliable way to do this is to write to the alarm properties from a valueChange event script on the property of interest.
1 Like