Nested Paths Not Allowed (Perspective)

Hello, I am new to Ignition and still learning.

I am creating a template with Indirect tag bindings. The goal is to have a user click on a pump and a popup will open of a template to auto populate the tags within the template.

I have been making progress using custom parameters and the indirect tag bindings. However, I have ran into an issue where I need a button to change colors based if it is pressed or not. This button needs to see if the pump is in “Hand” AND if the pump is on or off. So if the pump is in “HAND” and you press the “ON” button, the button will change colors to signify the pump is on.

I have very limited knowledge when it comes to expressions and scripting so I came up with the following expression for this:

(!{[default]Sadorus Pump Station/Controller:Global/SBS_PUMP_1/DS_AUTO}) & ({[default]Sadorus Pump Station/Controller:Global/SBS_PUMP_1/DI_ON})

If the pump is NOT in “Auto” AND the pump is “On”, this will bring back a value of 1 which I can transform into a color.

So to make this an indirect binding, I would change the “SBS_PUMP_1/DS_AUTO” and the “SBS_PUMP_1/DI_ON” with the parameter in the template. So it will look like:

(!{[default]Sadorus Pump Station/Controller:Global/{view.params.PumpStateTag}}) & ({[default]Sadorus Pump Station/Controller:Global/{view.params.PumpStatusTag})

However, upon doing so, I get the following error:
“Nested paths not allowed”

Could I have some assistance on this?

First, the logical AND operator is &&

If you need to dynamically call tags from an expression then you need to use the tag() expression function.

(!tag('[default]Sadorus Pump Station/Controller:Global/'+ {view.params.PumpStateTag}) && (tag('[default]Sadorus Pump Station/Controller:Global/' + {view.params.PumpStateTag}))

Thank you for the reply,

However, upon entering your code, I get a “Error_TypeConversion” error. But it also brings back a value?

Psst! Don’t use tag(). There be dragons.

Use indirect binding to bring those booleans to custom properties in your template. (Internal or on the template’s components.) Then use those properties in your expressions.

1 Like

Do said dragons apply to perspective as well seeing as how you’re already at the gateway?

Well I got it working using the following code:

(!(tag("[default]Sadorus Pump Station/Controller:Global/" + {view.params.PumpStateTag}))) && (tag("[default]Sadorus Pump Station/Controller:Global/" + {view.params.PumpStatusTag}))

However, is using the “tag()” option a bad way to do it?

When you say “Use indirect binding to bring those booleans to custom properties in your template” could you elaborate?

Thank you for the help!

Historically, tag() just slowed Vision down. It tends to crush Perspective.

Create view custom properties for each boolean that would otherwise need the tag() function. Use indirect binding to combine your static and dynamic tag path parts for those booleans to bring their live data into the view. Then construct your expression with those properties in place of the tag() expressions. It also eliminates multiple identical tag() expressions when you use a particular boolean in more than one spot in the expression.