# Indirect tag and calc

**URL:** <https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328>\
**Category:** Ignition\
**Created:** [February 11, 2021, 9:14pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328 "2021-02-11T21:14:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![philippeg](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@philippeg](https://forum.inductiveautomation.com/u/philippeg)\
**Post date:** [February 11, 2021, 9:14pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328/1 "2021-02-11T21:14:21Z")

</div>

Hello  
I have objects containing indirect bindings.

for instance Indirect tag path {1} and where Ref {1} is Root container.Phase\_number  
Phase number contains a Tag name  
this Tag is actually a Float

when I display this {1} I would like to add (+) a other number either a constant like 10 or and value contained in another indirect binding say Ref {2}

I tried to insert math function inside the indirect tag path but it does not seems to work  
Any idea ?

thanks a bunch  
regards  
Phil

---

<div class="post-metadata">

**Author:** ![pradeepvarma](https://avatars.discourse-cdn.com/v4/letter/p/9d8465/32.png) [@pradeepvarma](https://forum.inductiveautomation.com/u/pradeepvarma)\
**Post date:** [February 11, 2021, 9:36pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328/2 "2021-02-11T21:36:30Z")

</div>

Use expression binding. The tag function fetches value of the tag if you provide tag name as string.  
I would do this in your case  
tag({Root container.Phase\_number})+10

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 11, 2021, 9:55pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328/3 "2021-02-11T21:55:52Z")

</div>

Put any constants right in the string at the top. (On either or both sides of the `{1}`.) Place a `{2}` where appropriate in the string at the top and another reference box will show up below.

The references themselves are cannot be expressions, and are substituted after stringification. If you have complicated manipulations, you can use another custom property with a string expression, then use that in a reference.

If you are wise, you will _not_ use the tag() function.

---

<div class="post-metadata">

**Author:** ![philippeg](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@philippeg](https://forum.inductiveautomation.com/u/philippeg)\
**Post date:** [February 11, 2021, 10:26pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328/4 "2021-02-11T22:26:13Z")

</div>

Hi, I’m sorry, what do you mean by put a constant ? like {1} + 10 ?  
Also, what is the issue with the tag ()  
Sorry I’m new on ignition and trying to convert something from a package I know upside down to this one, sure, thing are not comparable, to be expected

thanks  
Phil

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 11, 2021, 11:03pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328/5 "2021-02-11T23:03:47Z")

</div>

You should create a separate custom property with an expression binding to add Phase\_number and 10. Use that property as your `{1}` reference instead. The tag() expression function has a number of performance implications that mean you should avoid it. A search on this forum for me and tag() will turn up a number of discussions about it.

---

<div class="post-metadata">

**Author:** ![philippeg](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@philippeg](https://forum.inductiveautomation.com/u/philippeg)\
**Post date:** [February 12, 2021, 6:16pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328/6 "2021-02-12T18:16:09Z")

</div>

The issue is that Root Container.phase\_number contains the IO address so when I do Tag({Root container.Phase\_number})+10 it is not interpreted a math operand it is adding 10 to the string so if the Tag({Root Container.Phase\_number}) is equal to 90 then the display is now showing 90.01 which is 90.0 plus 10 as a string

Any idea how to fix that ?  
thanks  
Phil

---

<div class="post-metadata">

**Author:** ![pradeepvarma](https://avatars.discourse-cdn.com/v4/letter/p/9d8465/32.png) [@pradeepvarma](https://forum.inductiveautomation.com/u/pradeepvarma)\
**Post date:** [February 17, 2021, 8:56pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-and-calc/43328/7 "2021-02-17T20:56:19Z")

</div>

toInteger(Tag({Root Container.Phase\_number})) + 10  
Tested and it works.
