# Binding Errors at Design Time

**URL:** <https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233>\
**Category:** Ignition\
**Created:** [April 27, 2020, 1:28pm UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233 "2020-04-27T13:28:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Lee](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Kevin\_Lee](https://forum.inductiveautomation.com/u/Kevin_Lee)\
**Post date:** [April 27, 2020, 1:28pm UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233/1 "2020-04-27T13:28:45Z")

</div>

Hi there,

I have a question regarding bindings at design time. I saw a similar topic back in 2017 and I think this maybe along the same lines but there didn’t seem to be a definitive solution.

I have created vision templates which have a template parameter defined. This parameter is a UDT and I then bind various elements of the UDT to animate the template. So for example I have a circle which has an expression binding property on it which references the UDT. The syntax of the binding is as follows…

If (({AV.CW::AV\_CW} = 1, color (255,255,0), color(25,0,0))

However, the designer throws the following error  
Error executing expression binding on  
AV.AV.Group 1.Polygon 2.fillPaint  
caused by ExpressionException: Unsupported types for BAnd: ‘null’ and ‘java.lang.Integer’

At runtime no errors are generated but in the designer I have in excess of 200 errors due to bindings on various objects. Is the issue that at design time the object cannot bind to the runtime instance of the UDT? If so how do I stop the error occurring? Any help on the above would be gratefully appreciated.

Kind Regards  
Kevin

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 27, 2020, 1:36pm UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233/2 "2020-04-27T13:36:58Z")

</div>

couple your if statement with the try statements:

```auto
try(
    If(
        {AV.CW::AV_CW} = 1,
        color(255,255,0), 
        color(25,0,0)
    ),
    color(25,0,0) <-This is the color that will initially show up when the compare is still working on binding
)

```

---

<div class="post-metadata">

**Author:** ![Kevin\_Lee](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Kevin\_Lee](https://forum.inductiveautomation.com/u/Kevin_Lee)\
**Post date:** [April 27, 2020, 2:23pm UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233/3 "2020-04-27T14:23:17Z")

</div>

Thank you ever so much, that worked great.

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [October 13, 2021, 4:54am UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233/4 "2021-10-13T04:54:11Z")

</div>

Hi all, i was having a similar issue, just that my error message was:  
caused by ExpressionException: Unsupported types for BAnd: ‘null’ and ‘null’

I have a button, and my display Text expression is:

```auto
if(({tag1} & !{tag2}), "PAUSED",
	if({Root Container.Other Button.indicatorValue}=1, "STARTED", "START")
)

```

I have tried the try() function, and it is working, not more error popup.

But i would like to know what is the root cause? As it is not really solving the issue, just “hiding” it…?

---

<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:** [October 13, 2021, 2:51pm UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233/5 "2021-10-13T14:51:38Z")

</div>

Should be two ampersands. A single is for bitwise `AND`, aka `BAnd`.

The root cause is that tag bindings in a Vision Client don’t have a value when they start–there’s a gateway round-trip that must happen at startup. Expressions must immediately return an answer, so tags are null or sometimes `-1`. The `try()` function is the simplest way to get past the problem.

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [October 14, 2021, 6:16am UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233/6 "2021-10-14T06:16:44Z")

</div>

Hi Phil, thank you very much for the explanation!  
Yes, there was a missing “&”.  
I thought that it was something with my if() expressions, and hence kept troubleshooting in that direction.

---

<div class="post-metadata">

**Author:** ![damien.tiede](https://avatars.discourse-cdn.com/v4/letter/d/e480ec/32.png) [@damien.tiede](https://forum.inductiveautomation.com/u/damien.tiede)\
**Post date:** [January 27, 2022, 2:22am UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233/7 "2022-01-27T02:22:41Z")

</div>

Hi, does anyone else see a problem here ?  
If there is a genuine bug with the expression, you might never be alerted to it because it gets caught by the try block!  
Without the try block, exceptions will keep appearing in the designer letting you know there is a bug.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [April 12, 2022, 4:16am UTC](https://forum.inductiveautomation.com/t/binding-errors-at-design-time/34233/8 "2022-04-12T04:16:46Z")

</div>

It does seem like a pretty bad way to bandaid it.  
I also have been wondering lately, has the way “&” and “&&” been treated in expressions changed between 7.9 and 8.1? I am getting many more expression errors similar to this lately after the upgrade, where i never used to in 7.9.
