Each tag (34 total) was made with a UDT, and has three parameters that I need to utilize. Percentage - which are the decimal values displayed, and further displayed in the pink box (decimal values) Volts - which is only displayed in the yellow box (decimal values) Enabled - which is indicated by the color of the Percent labels (values: 0 or 1)
The label shown with "CZ01" displayed, is linked to view parameter zoneKey, which is part of a tag name, so we know which area we are adjusting. Con and Bay are used to tell us which side of the machine we are adjusting.
The labels on the left side of the view, with decimals, are bound to tags. The center column is for an area description. When the decimal label is clicked, the view parameter is updated to the area description, i.e. CZ01. This is also a part of each tag's name, which allows me to use indirect binding to the pink and yellow components. The "Enable/Disable" button text is also bound to a view parameter, to indicate if the tag is enabled or disabled. So far so good.
I don't know if I am making this harder than it should be or am I following the right path?
Also, I noticed that the binding on the yellow box, won't allow for bi-directional.
You can create a custom property on the components that have a transform. Name it something like raw_value. Add your indirect binding to it which will allow bi-direction, then bind your actual value or text prop to the raw_value with the transform added there. Then anytime you want to write to the tag, write to the raw value prop instead of the value/text prop.
So here's my solution:
The two view params used for enabling/disabling a tag are indirectly bound to a tag using the view param zoneKey and are shown as "bidirectional" in the params box, but not in the binding. (Does anyone have any insight into the difference here:
This versus bidirectional tag binding...
The plus/minus script action is simple, check for the enabled bit, 1, get the current value and add a predetermined incremental value. If the resulting value is above a certain set point, use the set point value.
The Enable buttons simply change view params enable bit.
One issue I had was that the labels with decimal values on the left, when clicked/tapped, they would also write to the view params enable bit, creating a bit of confusion and a circular like read/write.