I have done some modification on a copy of my initial window. The problem is coming from a specific template.
This template is structured like this:
templateGroup
- 2x template1 (these ones change color)
- 2x template2 (basically a label linked to the template2 name)
- 1 template3 (2 states toggle button linked to a read/write tag)
- 1 template4 (2 states toggle button linked to a read/write tag)
- 1 template5 (a CSV from the Symbol Factory)
The UDT driving template1 contains a string Memory Tag containing about a dozen r,g,b colors and anExpression Tag consisting of many if() function embedded in each other, returning a r,g,b string :
tag: UDT tag
color: r,g,b from the Memory Tag
if (tag,
if(tag && tag=color ,
color,
color),
if (tag,
if (tag && tag=color,
color,
color),
if (tag && tag!=color,
color,
if (tag && !tag,
if(tag!=tag,
color,
color),
if (tag,
color,
if (tag,
color,
if (tag,
color,
if (tag,
color,
color))))))))
template1 “Fill Paint” shape read the UDT tag with toColor() expression function:
toColor(UDT Expression Tag)
I reorganized by copying the original shapes from template1 and template2 directly into templateGroup, so I only kept the original shapes. It seems to accelerate the process, but isn’t enough.
I considered your suggestion of doing the expression in the display. This was the original way I did it, but since I have 8 other templates like template1, which are representations of a straight or round conveyor in all direction, using the display to run the expression forces me to update each template expression seperately when we do modifications to the PLC.
Would it be faster to use a shared/project script instead of the expression, so every template would call that script to get the color. That way I would remove the expression and the memory tag, diminishing the traffic from/to the gateway.