# How to use a button to change the TAG that is being bound to an LED display (or any component)?

**URL:** <https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [October 8, 2020, 4:34am UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483 "2020-10-08T04:34:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason.jones](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jason.jones/32/18671_2.png) [@Jason.jones](https://forum.inductiveautomation.com/u/Jason.jones)\
**Post date:** [October 8, 2020, 4:34am UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/1 "2020-10-08T04:34:02Z")

</div>

HI there, complete newbie so forgive me if this is obvious.  
I am creating a view that will emulate the functionality of a 3 phase power meter that I can interrogate via MODBUS.

1. Upload a decent picture of the power meter
2. The physical unit has a 3 line display so over lay 3 LED displays on the picture …
3. So far so good the LED’s are displaying the 3 voltage tags that I used in real time
4. Next, the Power meter has a couple of buttons that toggle through the various parameters… current, PF, KW.h etc… so “screen grab” just the button from the original source picture and create a button over the picture on the view
5. Now find a way to link clicking the button to change the MODBUS tag being displayed by the LED item… maybe indirect binding via a script?
6. Realise that the vastness of my inadequacy requires me to seek a higher power… the FORUM!!!  
I havent found a video or a topic or an example to plagiarise as yet… so any suggestions would be most welcome.

---

<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 8, 2020, 12:43pm UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/2 "2020-10-08T12:43:13Z")

</div>

> [@Jason.jones](#):
>
> maybe indirect binding via a script

Yes, a string property that contains the path or the changeable part of the path for the changeable display. The actionPerformed event on the button would look up the current string value to then pick the next string value. For that part, I'd use a constant list of strings in a script module. Find the current string with .index(), add one (roll over to zero at the end) to get the next string.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 8, 2020, 1:16pm UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/3 "2020-10-08T13:16:10Z")

</div>

My take would have been to use a dataset with values and changeable parameters to use in indirect tags.

Here’s a mockup you can play with. Tags used are client tags, but feel free to plagiarize away. 🙂

[PowerMon\_2020-10-08.zip](https://forum.inductiveautomation.com/uploads/short-url/yGx1dPfsUPMK7SDZ8sNrYkk6i4d.zip) (10.1 KB)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/0/b0c7aaa886e5029ed2096d3a83aaaa7e9a941ccc.png)  
Take note of:

- Custom properties on the group (called meter, because I’m creative that way) and it’s bindings, where applicable
- Scripts on the up/down buttons to adjust the pointer and checking the size of the dataset. That way, if you adjust the size if the dataset, it won’t throw you into a tailspin.
- Indirect tag bindings on the LED Displays

---

<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 8, 2020, 1:18pm UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/4 "2020-10-08T13:18:36Z")

</div>

Aww, Jordan! You’re supposed to make the newbies _work_ for it. 😆

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 8, 2020, 3:09pm UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/5 "2020-10-08T15:09:41Z")

</div>

Jason’s a visual learner, like me. 😉

---

<div class="post-metadata">

**Author:** ![Jason.jones](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jason.jones/32/18671_2.png) [@Jason.jones](https://forum.inductiveautomation.com/u/Jason.jones)\
**Post date:** [October 11, 2020, 11:54pm UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/6 "2020-10-11T23:54:06Z")

</div>

Thank you … thank you thank you for your assistance … forgive me for my slack response time 🙏 Now I just have to visualise how to use it… where’s my hammer

---

<div class="post-metadata">

**Author:** ![Jason.jones](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jason.jones/32/18671_2.png) [@Jason.jones](https://forum.inductiveautomation.com/u/Jason.jones)\
**Post date:** [October 27, 2020, 8:40am UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/7 "2020-10-27T08:40:21Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/17e45d968e8daec4b84ff57034c11d422b01bafe.png)

I have finally found my hammer and I am trying to work for it… but I just ended up hitting my thumb with it. Was that a project export?.. that I import and then like Aladdins cave shows me all sorts of goodies like a perspective view and such … cause at the moment I cant find the treasure.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68f1d8f89d9cc530c0abc21b7ae661e385c4205f.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 27, 2020, 10:10am UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/8 "2020-10-27T10:10:57Z")

</div>

Yeah, that was a project export. Try importing it into a blank project. That way, you shouldn’t have any extra stuff to get in the way.

---

<div class="post-metadata">

**Author:** ![Jason.jones](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jason.jones/32/18671_2.png) [@Jason.jones](https://forum.inductiveautomation.com/u/Jason.jones)\
**Post date:** [October 27, 2020, 10:35pm UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/9 "2020-10-27T22:35:24Z")

</div>

I tried a blank project … but shouldn’t the view you created show up in the import window where it allows you to select what items to import? The first screen grab is what is available in the PowerMon zip … the second screen grab is from the help for the import process.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [October 28, 2020, 4:07am UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/10 "2020-10-28T04:07:36Z")

</div>

I think @JordanCClark’s export includes a Vision window rather than a Perspective view.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/b/abee211e3582b92b888b823cb90878b5d655f396.png)  
After import, look for it here:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/d/8d975357a3246e783dc04419439f867fd0338743.png)

---

<div class="post-metadata">

**Author:** ![Jason.jones](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jason.jones/32/18671_2.png) [@Jason.jones](https://forum.inductiveautomation.com/u/Jason.jones)\
**Post date:** [October 28, 2020, 8:39am UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/11 "2020-10-28T08:39:56Z")

</div>

I think the Maker Edition (which I am using) doesn’t include the Vision module?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 28, 2020, 9:16am UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/12 "2020-10-28T09:16:21Z")

</div>

Maker Edition? That would have been handy to know. 🤪

I’m not at my PC yet, but I’ll see what I can do for you.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 28, 2020, 11:06am UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/13 "2020-10-28T11:06:54Z")

</div>

Okay Try this one. You’ll need to import the tags separately.

[powerMonDemoTags.json](https://forum.inductiveautomation.com/uploads/short-url/rt0CVF2iWhayKW21H8hU0yRQ63c.json) (1.7 KB)  
[powerMonDemoPerspective.zip](https://forum.inductiveautomation.com/uploads/short-url/jxE2m7Na8ZrbAbwXq2jWBkAexZX.zip) (10.3 KB)

---

<div class="post-metadata">

**Author:** ![Jason.jones](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jason.jones/32/18671_2.png) [@Jason.jones](https://forum.inductiveautomation.com/u/Jason.jones)\
**Post date:** [October 28, 2020, 10:46pm UTC](https://forum.inductiveautomation.com/t/how-to-use-a-button-to-change-the-tag-that-is-being-bound-to-an-led-display-or-any-component/39483/14 "2020-10-28T22:46:15Z")

</div>

Sorry about that Jordan… yep that worked perfectly. I hadn’t got to the point in the videos that triggered the realisation that Maker edition doesn’t contain all the “basics” from the full version. I was about to install another version and let it run in trial mode so I can look at your vision version.
