Vision Template SCAN ERROR Nested Paths not allowed

Ignition Vision Template
8.3.1

In Template custom properties,
I’ve defined several properties.

I am using Tank level NC/NO floats wired to a PLC to determine a value for tank fill level.
The If statement below works when I hard-code the float tag into the formula.
Well not really hared code it, pass it to another custom properties so I can edit the formula in designer

What I would like to do is use the custom properties to determine the float “number

I use the custom properties in the template and it will work in designer when I assign a number to the float.
The float icon color will change correctly based on if tank float is High or Low (1 or 0)

For value of tank level

Hard code the Float number and it will calculate a value.

if(

{[Sample_Tags]Floats/Float 04.value}=1,100,

if(

{[Sample_Tags]Floats/Float 03.value}=1,75,

if(

{[Sample_Tags]Floats/Float 02.value}=1,50,

if(

{[Sample_Tags]Floats/Float 01.value}=1,25,0

))))

If I try to use the “Template Custom Property” as a variable is will give me the error:

SCAN ERROR Nested Paths not allowed.

if(

{[Sample_Tags]Floats/Float {Tank_4Float_2Pump (value).Float_Top_1}.value}=1,100,

if(

{[Sample_Tags]Floats/Float 3.value}=1,75,

if(

{[Sample_Tags]Floats/Float 2.value}=1,50,

if(

{[Sample_Tags]Floats/Float 1.value}=1,25,0

))))

There are several trends on “Nested path errors”
I tried several ways. Custom properties, template parameter tag, Internal properties tag.
I always get the same error. SCAN ERROR Nested Paths not allowed. (line1, char 31)

I thought my best hope was to use CONCAT with in the “IF” statement
but

concat ("{[Sample_Tags]Floats/Float ",{Tank_4Float_2Pump (value).Float_Top_1},".value}")
Will return a value of
{[Sample_Tags]Floats/Float 4.value}
Which is good.

If I try to put that into the “IF” it will not return a value.
if(concat ("{[Sample_Tags]Floats/Float ",{Tank_4Float_2Pump (value).Float_Top_1},".value}")=1,100, …………….

I tried putting () around CONCAT statement but made no difference, will not return a value

I’m at a loss

Any help or thought would be greatly appreciated.

Ps. This is my first project in Ignition.
I’m probably not understanding all the terms in other trends.
Treat me like an idiot when you explain.

The project does work but I would like to make the “IF” statement work using indirect tag to the correct floats.

The more you play, the better you get at making things easier to repeat.

Best regards.

PS, Playing from home so I just made some memory tags to make toggling floats and pumps easier.

Can you edit your post to have your code as preformatted text? It helps with legibility. Please see Wiki - how to post code on this forum.

This line is your issue. Look into how to make and apply indirect tag bindings:

You'll need to create internal custom properties on your template to hold the actual float values. Apply indirect tag bindings to these internal properties, and use them in your if statement.

1 Like

To expand a bit on the problem; what you're trying to do is natural (evaluate this reference, and use that reference as part of another reference to evaluate) but is not supported (hence the many errors you ran into).

The immediate solution is to do what Ryan's suggesting and use intermediate custom properties - basically instead of a single expression with multiple layers of evaluation, split the two layers out into two expressions/tag bindings.

All that said - there may be a more direct way to express the same end goal you are trying to reach - I can't quite follow what you're doing but if you can expand a little bit on what you're actually trying to do we might be able to help guide you to a "cleaner" solution.

Yes, that is the problem.
I remember watching the video on the Tag Binding.
After watching it again, Ok, several times.
It finally made sense, how I could use 2 binding to create one tag.
Created 2 internal properties
One used as an expression to convert to a digit.
A second property as an indirect tag. used the number from the expression to calculate which float.

Hi, I have a series of tanks, Grouped by 4 tanks thru an equalization pipe. Tank level is controlled by floats. only the first tank in each group of 4 has floats. There may or may not be pumps in each tank.

Used fill to display tank level but use floats to send it a fill level. I could have used a color block to show different levels of tank but not all tanks have 4 floats, some have 3 or less.

All float tags are numbered, by entering a float # and “1” in visible property, I can control which floats show level with out having a blank spot in tank if there were only 3 or 2 floats.
PS, I just made some memory buttons to toggle floats and punps.

Same tank template
1st tank: setting floats 8,7,6,5 with visible set to 1’s Pumps set to 5 and 6
2nd tank: setting floats 8,7,6,5 with visible set to 0’s Pumps set to 7 and 8
3 rd and 4th tank: setting floats 8,7,6,5 with visible set to 0’s Pumps set to 0 and 0

This set of tanks has 2 tanks but only 3 floats for level.
Same template as above
1st tank : floats are 16,0,15 and 14 visible is 1,0,1,1 pump 1 and 2
2nd tank Floats are 16,0,15 and 14 visible is all set to 0 and pumps are set to 0

Hope that makes sense and not boring to death.

It is functioning as I would like it too after figured out the binding