We are developing a bunch of custom widgets for a system. A good example would be a generic valve in a system that requires 50 instances of it. We want to be able to display the state of the valve, ie “Opening, Open, Closing, Closed” using the Text System for localization.
I am aware of Indexed Text Snippets to achieve this. However, it is not apparent how we might scale this method to the 50 instances of the widget without a bunch of copy-paste-type work.
One idea I have is to pass through an OPC-UA variable the TMX path to display in a TextOutput inside of the compound widget. TextOuput can be use to display Localized text.
I think that you are using Structure binding to pass all informations about your valve to the compound widget ?
Like this you just have to manage in PLC this TMX path as a string variable.
Here an example :
Assuming ValveHmi variable is a structure (“ValveInfoType”) dedicated to 1 valve and for compound widget of valve.
Plc code
IF Valve.Openning THEN
ValveHmi.StatusTmx := "$$IAT/ValveStatus/Openning"
ELSIF Valve.OpenTHEN
ValveHmi.StatusTmx := "$$IAT/ValveStatus/Open"
ELSIF Valve.Closing THEN
ValveHmi.StatusTmx := "$$IAT/ValveStatus/Closing "
ELSIF Valve.Close THEN
ValveHmi.StatusTmx := "$$IAT/ValveStatus/Close "
ELSE
ValveHmi.StatusTmx := "$$IAT/ValveStatus/Undefined"
END_IF;
Now just activate your structure variable in OPC-UA server and create a binding on the variable directly on the property on the compound widget “ValveInfo”
Thank you @florent.boissadier and @kovarj. This looks aligned with what we want to accomplish. We will try this out and let you know if other questions arise.