11-07-2022 01:14 PM
New to G web development - I was wondering how to update multiple indicator values using control reference.
I don't want to create individual control reference for each one of the indicators present on the Panel.
Solved! Go to Solution.
11-07-2022 01:35 PM - edited 11-07-2022 01:36 PM
If they're separate indicators then you need each reference. The other option is to collect them into a cluster and then you can have a reference for the cluster and update all of them at once but lose the ability to work with them individually as easily.
You can collect the references into an array to make it more streamlined to just iterate over them and set values.
11-07-2022 01:39 PM
I thought about it and ended up thinking - How are the clusters handled as part of the tags ?
11-07-2022 03:24 PM
11-07-2022 04:09 PM
Yes system link tags
11-08-2022 10:30 AM
If you're getting an array of values from tags and have a corresponding array of references you can iterate over both and use a value property node to update the indicators. Just need to make sure the reference array and values line up.
11-15-2022 09:57 AM
That's a good solution than what i have found so far. But i think it would be really difficult to control reference array and value line up where there are many tags. I should probably explore the tag properties to see if we can set some order in there.
I am attaching a screenshot of how i did it in the mean time. My tag list is quite long.
11-21-2022 05:52 PM
Yes something like that would be a better route; anytime the terminal can be used directly (opposed to using a reference) then that will generally be the preferable route.
You could use the array of references and property nodes to pull the label text out into an array that could be used to lookup which control index the value should be written to. This would allow just tacking tag names in arbitrarily (and not having issues if the tag API changes their sorting) and adding control references anywhere in the array but of course it would perform a little worse than the case structure selection.
11-22-2022 09:38 AM
I was kind of aiming to achieve that and was not very definitive before you mentioned the programming route as below. I know now and the performance difference between both.
Thanks for all your support.