Bad quality of components at client start

Hi there!

Hope I can find help from the community. I have the following problem:

I have a template where there are a few components. These components take their value from an expression. If a certain condition is true then the value comes from an OPC Tag, otherwise the value becomes itself (last value).

I used some of this template in a window. The problem is that when I start a client and the condition (for the component value) is false, then I have a problem with the data quality until condition becomes true and components take the value from the OPC tag. (I suppose it is like it has a null value at the beginning but I believed the first value is the value that it has in the properties tree in the designer)

The question is:
How can I fix the components quality (give a fixed value or take the last value from historical for example) until it takes the correct value?

Thanks in advance!

You could store these values in HMI tags rather than as a property of the component. The downside is you would need to create all of the applicable memory tags and hopefully they will map well into the template scheme.

You could use the quality property of an OPC tag in an IF statement to use a known value until the OPC tags are available?

Thank you 0sm0,

I think the problem is not the quality of the OPC tag which is probably right, but the quality of the component value which seems not to be initialized at client launch, having bad quality (unknown or other) until capture OPC tag value (after condition is true).

I have already tried the IF statement for the component value expression (if quality=192 then …) but the platform becomes unstable (high %cpu use) and finally I have to force to close tha application.

Thank you Tim. I should create more than fifty memory tags for that purpose (several templates of several machines). Probably it is not a smart solution.

I have realized that the problem only exists using the components into the template. If a do exactly the same without templates I have not this problem…

Any other solution?

Best regards.

Where you use the uninitialized properties in a binding, wrap the property in a coalesce() expression function, supplying an alternate value to use until the valid one shows up.

That is perfect pturmel!

This is the right solution. It works perfectly now.

Thank you so much. Regards.