# Memory tag bindings

**URL:** <https://forum.inductiveautomation.com/t/memory-tag-bindings/4442>\
**Category:** Ignition\
**Created:** [May 10, 2012, 1:21pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442 "2012-05-10T13:21:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [May 10, 2012, 1:21pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/1 "2012-05-10T13:21:58Z")

</div>

ClassCastException: Cannot coerce value ‘2’ into type: interface java.awt.Paint  
I am trying to tint a symbol using a memory tag as every data type and keep getting this error when I try to change the valuation of tint.

[youtube.com/watch?v=Ku0-Jctn … ure=relmfu](http://www.youtube.com/watch?v=Ku0-Jctnt1o&feature=relmfu)  
I watched this video and followed it exactly except instead of using a PLC tag, I’m using a memory tag.  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [May 10, 2012, 2:08pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/2 "2012-05-10T14:08:16Z")

</div>

It means you are trying to bind the paint property to a number. What binding are you using for the fill paint? Expression or tag? Can you post a screenshot?

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [May 10, 2012, 3:32pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/3 "2012-05-10T15:32:43Z")

</div>

![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/f/2f0984456f8dd47c5beb0a68b72c3d6cf62ef2aa.jpeg)  
its a memory tag binded to a color change property. I had used it as an integer… 0 1 2

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [May 10, 2012, 3:48pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/4 "2012-05-10T15:48:28Z")

</div>

![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/f/2f0984456f8dd47c5beb0a68b72c3d6cf62ef2aa.jpeg)

This one is a bit more clear…  
I’m using an int8 memory tag referenced to a color property.

---

<div class="post-metadata">

**Author:** ![Kakkerlak](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@Kakkerlak](https://forum.inductiveautomation.com/u/Kakkerlak)\
**Post date:** [May 10, 2012, 4:37pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/5 "2012-05-10T16:37:00Z")

</div>

The way I understand colors in Ignition is that they’re a complex data type. You can represent them in a few ways; the simplest is by a string name like ‘red’ or ‘blue’, and the most common is as a ‘tuple’.

color(75,255,71) is a nice light green, for example.

Are you looking for a continuously variable tint number, or just to color something red or green ?

The easiest way to change the color of a geometric object is to bind the StrokePaint or the FillPaint to an ordinary Tag, and use the color/value table.

Also: remember that an INT[8] is an 8-byte datatype. While memory is plentiful, you probably don’t need a 64-bit value to express a color.

EDIT: I watched the video you linked to and it shows the color/value table that is available when you bind a Color to a Tag or Expression. I followed the same steps, using an INT[8] DB tag, and didn’t get the same error message as you did.

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [May 10, 2012, 4:37pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/6 "2012-05-10T16:37:03Z")

</div>

You need to create a dynamic property on the screen object and bind your memory tag to that. Then create a Style customizer that consumes the property and toggles the Stroke Color or Foreground Color property.

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [May 10, 2012, 7:47pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/7 "2012-05-10T19:47:00Z")

</div>

OK I learned that this error was because I did not have the latest version of Java installed.

---

<div class="post-metadata">

**Author:** ![Kakkerlak](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@Kakkerlak](https://forum.inductiveautomation.com/u/Kakkerlak)\
**Post date:** [May 11, 2012, 12:31am UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/8 "2012-05-11T00:31:14Z")

</div>

Thanks for the update ! I was scratching my head about what we might have done differently.

Can you post what version of Java you had previously (that included that error) and which one you’ve updated to ?

I’m running Java 1.6.0\_31 on Windows 7 Professional x64.

Handy tip: you can look up your Java version here: [http://javatester.org/version.html](http://javatester.org/version.html)

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [May 11, 2012, 12:15pm UTC](https://forum.inductiveautomation.com/t/memory-tag-bindings/4442/9 "2012-05-11T12:15:12Z")

</div>

I’m not sure what version it was before, but im running windows 32x and it updated it for me so I must have not had the up to date version.
