Expression Tag Erratic Behavior - get unexpected result value

Hi,

I have an expression integer tag with a very simple logic. I realized recently that the result tag is completely wrong and does not follow in realtime expression conditional logic. I mean, when the input condition is true and I expect the tag value to be 1, it is getting another random value and opposite. I checked by reviewing historian values for all tags involved and made sure they are using same tag groups and storing at same rate. Also, know that the historian is not the issue because used sepasoft OEE engine to collect this tag value and it collects the wrong values.

I also tried the three different methods of expression execution with same bad results

I also searched everywhere in my project to make sure no other view, binding or script is writing on my tag

Is there a known issue or watchout with these expression tags or has anyone had similar issue?

Thanks

image

Is {[.]LineRunning} an integer or a boolean?
If it's a boolean then try,

if({[.]LineRunning},
    1,
    {[.]../PLC Tags/current_fault_capture}
)

Line 1 of the expression will return a trueor false.

What scan class have you got on the two tags? (i.e., how often do they update?)

2 Likes

LineRunning is boolean and I had that logic before with same issue, this is why I tried =1 instead with no changes.

They are all on default scan class, 1 second.

As a test, create custom properties and bind line running and the fault code tags. Use the custom properties in the if expression. See if the behaviour changes.

Edit: nm….glossed over the first sentence that it was an expression tag and not an expression binding in the UI.

This an expression tag, not an expression in a UI.

1 Like