Is it possible to set visibility of an instance of a template within a template repeater dynamically, based on an expression that uses the value of an indirect tag bound to a template custom property?
The way that I think this would have to work is that all the custom properties of the original template are copied as custom properties within the template repeater to an indirect tag that has a dynamic instance integer. In my case, for example there is a circle that turns from red to green when an input off an aux contact on a motor starter goes high. The path to the custom property on the original template looks like:
controls_unitop.unitop::equipment_1.servo_b.cfm_vis_
I think I could add a custom property to the template repeater indirectly like so
controls_unitop.unitop::equipment_{1}.servo_b.cfm_vis
Ok, so now every instance of cfm_vis is bound dynamically to an equipment #… right? If not please steer me in the right direction, I am familiar with using the template repeater, but I have not used it where I have a template custom property that is linked to a PLC tag dynamically. This functionality works by the way, I have a custom property that is mapped from a few inputs in a UDT to a PLC path. The problem is that I have to copy the template over and over again and so I am nesting many instances of this template within another template – a template repeater seems like a much better, less labor intensive (everytime we come up with a new control template for a given piece of equipment) option.
However the way that it works now is that instances of the templates have visibility based on expression, so that as a person fills in basic info it builds this control screen automatically and a header (also a template I would like to repeat) are displayed based on whether the “equipment_type” changes:
{controls_unitop.unitop::equipment_4.equipment_type}='' &&({controls_unitop.unitop::equipment_3.equipment_type}!= {controls_unitop.unitop::equipment_5.equipment_type}) &&{controls_unitop.unitop::equipment_5.equipment_type}!=''
Ultimately this expression needs to be dynamic with the equipment number
Here is what the “monolithic” UDT looks like where I would like all configuration to take place:
So these standard PLC UDTs have a 1:1 relation with the original template customer property. However there are many different equipment types, hence the visibility requirement for a given template. For example, for the servo template to be visible, the equipment type has to = servo:
{controls_unitop.unitop::equipment_5.equipment_type}='servo'&& {controls_unitop.unitop::equipment_5.equipment_type_version}=1
Hopefully you guys/gals can see what I am after. Ultimately I want the correct type of control to be visible for the equipment type but I don’t want to have to copy and paste (and nest) a bunch of template instances within a higher level template, rather I would like to leverage indirect binding and template repeater. The complication is there are already a bunch of dynamic property/tag bindings that exist for each template type. Once it is all set up it works great as is, but every time I need to add an equipment type, I need to copy 32 instances of the template into the higher level template (32 because that is what I have room for on the widescreen version of our “Controls” template).
What I am really after is
(1) confirm that I can maintain dynamic binding to PLC tag through template custom property > template repeater custom property > dynamic OPC path in UDT (again this works minus the repeater)
(2) how to refer to a template instance custom property dynamically with indirect binding in the template repeater and/or in the expression editor
(3) how to set visibility, I imagine ultimately at the highest level with an expression that references indirect tag binding from (1) and (2).
I am happy to clarify if need be as I will mindlessly be copying and pasting templates over and over again to fill out our new widescreen format until I or someone else can come up with solution that uses the template repeater + indirect binding (it is switching to a larger monitor that has allowed me this flexibility, on 4:3 we had a self-imposed SCADA style requirement that we wouldn’t put more than 7 pieces of equipment per screen).