Am I going about this in the wrong way

None of what you are attempting should require a script.

Create an array custom property on the view(make its access private). Each value in the array should be a dictionary with the members tagPath and aggregationMode. For each tag path, add the following expression: "[default]AllenBradley/Controller:Global/W" + {view.params.WellNumber} + "_Well_NeededItemHere".
Adjust NeededItemHere to be whatever tag you want from the well. Doing that should give you an array of objects that are accepted by a tag history binding.

From there, feed that array to the expression of a tag history binding on another custom property, and then bind that historical data to a time series chart. Tag history bindings have a poll rate that is configurable, so you could set it to 10s.

If you had the Integration Toolkit module installed you could have 2 custom properties, baseTagPath and requiredWellMembers, and use those to create the array automatically with an expression of

forEach(
   {view.custom.requiredWellMembers},
   asMap(
       "tagPath",  {view.custom.baseTagPath} + {view.params.wellNumber} + it(),
       "aggregationMode", "MinMax"
   )
)

Additionally, your Ignition tag names should not be the same as your PLC tag path. Rename and organize them in a way that benefits your UI design. Use UDTs and/or folders to group accordingly, regardless of where the tags exist in the PLC.

2 Likes