Expression tag not updating

We have a gateway expression tag that does not update, when viewed in a client or in the designer. The interesting thing is if we ‘refresh the provider’ from the tag browser in designer, the expression tag value updates.
The other strange aspect is that the state in the client only appears to update on the same computer as the designer that did the ‘refresh’.

Some of the tags comprising the expression tag are memory tags that have their values set via a client event script (may be relevant information).


Could you share the expression this tag uses, the type of each tag it references, and the client event script?
As a side note, unless you are being careful, I would imagine that having multiple clients open would cause your memory tags to obtain strange values since multiple clients would be trying to write to it at the same time via the client event script.

Since posting I have taken some steps to hone in on the issue. Previously the expression tag was the result of some other memory tags. A client script was also writing to these memory tags. I have removed that and now the expression tag is the result of 3 OPC boolean tags. The expression is:

&& !{[.]…/Active/OrderComplete}

The above expression does not update the client or the designer. Clicking refresh in the designer tag browser updates it in the designer, however the client maintains the old value. If I click the checkbox in the tag browser, this seems to force a client update and the client faithfully displays the value.

BTW I take your point about the client script perhaps not being suitable, although this is a single client system at present.

This may be a longshot, but what is the scanclass of this expression tag? I believe this determines the update rate of the expression, and if it is not set to driven or has a very long period that may be why you don’t see it update.
Maybe as a sanity check you could set the expression tag equal to a single boolean tag and establish that it works, and then move toward building you desired expression.
Since this expression tag does update after a refresh, it makes me think that you don’t have an issue with your syntax.

The expression tag is set to the Default scan class (1,000ms, Direct). In giving this some more thought, I am concluding that the value of the tag is actually changing correctly however it’s like I’m not getting the ‘data changed’ event on the client or in the designer. I wonder what is the mechanism by which clients are updated when a tag’s value changes? I am now evaluating the same logic in the PLC to a single OPC tag and side-by-side in the designer I can see the difference in values. Refresh the tag browser and the values are the same…

Perhaps something went wrong with the serialization of the page or template.

Does it also happen when you recreate the page (or perhaps just that binding to test)?

Using the following code (when put on a button on the window), you can also take a look at the serialization of the page, or the serialization of a single object, but it’s not easy to read (certainly when you can’t compare with a working page).

from com.inductiveautomation.ignition.common.xmlserialization.serialization import XMLSerializer
window= event.source.parent.parent.parent.parent 
ser= XMLSerializer()
serializedText = ser.serializeXML()
print serializedText

Thanks for the reply Sanderd, although it won’t help explain why the tag value does not update in the tag browser.

Is that the only expression tag you have that doesn’t update automatically from all the tags you have?

One other question, do those 3 BOOL tags update on their own fine but the expression tag wasn’t updating? I tried your expression code using some memory tags and worked fine so I was curious maybe those 3 BOOLs weren’t updating properly causing the expression tag not to update and when you manually refresh the tag browser, it would force the tags to update. Just a thought…
Also might help to create 3 test tags and use those with your expression tag and manually toggle them and see if your expression tag changes. Just throwing ideas out.

On a 7.9.10 gateway I had an expression tag that did a simple calculation on an OPC tag. The expression tag updated on some installations and not on others. I fixed it by making the two tags reference the same scan class. The non-working configuration the OPC tag was being scanned every 250 milliseconds and the expression tag based on the OPC tag had a default scan class (1000 ms). When I changed the expression tag to the 250 milllisecond scan class that was the same as the OPC tag everything worked. Note: Both tags were inside a UDT.