Most efficient tag binding method?

I’ve got a popup window that opens when an operator clicks on the object on an overview page.

I’m getting data from a modbus device so I’ve added all my tags from the PLC to a folder named tagDB.
While I technically could create a UDT off the tags at this point, that seems needlessly redundant to me.

So I’ve got two basic ways to get the tags into the popup to be manipulated.

The first option is to create custom properties for every tag I want. The downside to this is that I would have to create a unique custom property for every tag property I’d want to access also (I.e. for a Boolean with an alarm I’d have 3 customer properties, the tag itself, AlertActive, and AlertAcknowledged)

Alternatively, I could manually write a script to manually get the tag every time I need to access that property. By doing something like

tag ( Concat("tagDB/",{Root Container.NAME_POPUP}, "_CLOCK_DOW"))

My question is, is one method more preferred over the other? I’m potentially doing a lot of scripting on this popup, or I’m creating a lot of custom properties. Are they equal or does one take more processing power over the other?

Add a string property to the root container of your popup window that will hold the tag path to use. The use indirect binding elsewhere in the popup to retrieve the tag value and any of it properties.
Then, in your actionPerformed scripts in the overview window, when calling openWindow() and friends, pass the tag path that applies to the object the operator clicked on.

Hi Pturmel, yes I’m familiar with the indirect tag binding and how to pass the tag path into the popup. Though I didn’t explicitly state it, the indirect tag binding is how I accomplish the first option I listed.

The problem is if I want to do something like change a fill color based on the current alarm condition (Active and unacked, active and acked, clear and unacked, clear and acked). To do that using indirect tag binding and custom properties I have to create a unique custom property for the alarm condition and the acknowledged condition (If there is a way to create a custom property that gets all the tag extensions along with it I’ve missed it)

Alternatively I can create only the one base tag name (which I suppose could also include the tag path) and then use the tag expression with the concat expression as I build my expressions.

The plus side of the first is it makes cleaner expressions, but the down side is it has a lot more custom properties.

The down side of the later is I’m not sure how that much scripting will affect the system. Will the tag+concat method take a lot more processing power or will it take approximately the same amount of resources as a custom property combined with an indirect tag binding?

I ask because it’s easy enough for me to accomplish either method, but I’m curious how on a large system and how on a screen with a large number of objects will one method result in less tax on the processor.

I don’t understand why you insist that you need tag expressions with concat. The base tag name string can be used in multiple indirect bindings, each doing the appropriate concat for you. Bind your main value with{1}and your alarm status with{1}.AlertActiveAnd set both “1” parameters to point at the same string in your root container.

Because I'm not?

I've mentioned two ways of doing it and am asking which one, if either is more taxing the system.

[quote=“abishur”]Because I’m not?[/quote]OK. I misunderstood. I’m going to assume your original example, given just the NAME_POPUP custom property, has bindings for the values like so:Indirect for Value: tagDB/{1}_CLOCK_DOW Indirect for Alarm: tagDB/{1}_CLOCK_DOW.AlertActive Indirect for Ack: tagDB/{1}_CLOCK_DOW.AlertAcknowledgedIn the indirect assignment for {1}, you have {Root Container.NAME_POPUP} for all three bindings. When you open the popup window, you only pass NAME_POPUP.
To your question: Yes, indirect binding as above can be expected to be faster/more efficient than an expression with tag() and concat().