Hello,
I am developing a UDT for a phase which has 64 embedded instances of another UDT used for parameters and reports. This embedded UDT has a Boolean PLC tag called “Cfg_Has” which determines whether or not the parameter or report is used.
I would like to be able to have the embedded parameter/report UDTs to be dynamically enabled/disabled based on how many of the Cfg_Has tags are set to True.
My idea was to use an expression tag to calculate a “count” of the number of parameters where the Cfg_Has tag is True. Then use this tags value in the binding for the enabled property in an expression like: if({parameterCount} >= x, True, False)
Unfortunately, there was no way to do this as the enabled property only allows parameter bindings.
I was able to get the enabling/disabling of the embedded UDTs to work by using a parameter in the phase UDT called parCount where the number of used phases could be entered, and adding this binding to the enabled/disabled property for the embedded parameter UDTs. For each one, the binding is parCount / (parameter instance number - 1) * 2
So for a parameter count of 2, P_0 enabled would be 2 which equates to true, P_1 enabled would be 1 which equates to true, and P_2 enabled would be 0.5 which equates to false. And all of the following would be false as well. This was the only way I could think of to get the enabled property to be dynamic based on one UDT parameter since that binding does not allow scripting just transforms for the parameter value.
Is there a more robust way to do this? And is there a way to have this be dynamic based on the value of a tag rather than a UDT parameter?

