Wondering if anyone has metrics on the use of the Tag() function in an Expression, versus using an Indirect tag for displaying values within templates. Let's say 200+ analog & digital values on a Vision window as an example.
Expressions with Tag() gives you some flexibility with logic, but comes at a cost. Is that twice as much effort for Ignition to retrieve that value? Or is the performance difference negligible under a certain tag count? Or is it a difference in memory usage versus cpu?
How would performance differ on the initial page load? I seem to remember a note somewhere that Indirects on page load could be buggy or laggy (maybe that was a specific version release). Does Tag() have an advantage on initial load versus subsequent reads?
Just curious if someone has any technical insight on the performance difference. Thanks!
-MK
Every difference in behavior between the tag() function and indirect tag bindings is a negative against the tag() function.
tag(), like any expression function, must deliver an answer in the thread that is running the whole expression. But on expression startup that means waiting on the tag subsystem to establish the subscription and deliver the initial value. This creates stalls. Indirect tag bindings deliver asynchronously.
The string expression within the parentheses of tag() must re-execute every time tag() delivers a value, or anything else in the expression changes, whether the string would produce a new result or not. Indirect bindings' string source only re-executes when a fragment changes. (You can mitigate by moving the string computation to another custom property, but if you can do that, you might as well move the whole thing.)
Use tag() only where indirect binding is unavailable (expression tags).