I got some integer tags which bits represents distinct states. I require to convert to an integer tag that represents its state.
Any idea how to best implement this?
My initial approach is to use expression tag, and enable history. I am afraid though this will induce runtime log?
Second approach is to implement on gateway script, and do a write query to database for history?
What do you guys think?
Expression tag if you need history. Expression in the UI otherwise.
Consider using the binEnum()
function if the bits turn on only one at a time.
Ain’t Expression fall same issue with tag value change event limitation? "Tag Change" gateway event script vs "Value Changed" tag value event
Expression tags have different execution pool from tag event scripts. And expressions are much more efficient than jython. (Don't use runScript()
in your expressions to minimize chances of trouble.)
1 Like