# Indirection and templates for valve animation and control

**URL:** <https://forum.inductiveautomation.com/t/indirection-and-templates-for-valve-animation-and-control/4269>\
**Category:** Ignition\
**Created:** [April 10, 2012, 11:02am UTC](https://forum.inductiveautomation.com/t/indirection-and-templates-for-valve-animation-and-control/4269 "2012-04-10T11:02:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hensoa](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@hensoa](https://forum.inductiveautomation.com/u/hensoa)\
**Post date:** [April 10, 2012, 11:02am UTC](https://forum.inductiveautomation.com/t/indirection-and-templates-for-valve-animation-and-control/4269/1 "2012-04-10T11:02:26Z")

</div>

I am an ignition novice.  
I want to create a template that i can then place on a graphic page to represent a process valve.  
I would like the colour of the valve symbol on the template to represent the state of the valve  
eg. Grey = closed  
Blue = fail to open  
Red = fail to close  
Green = open.

I can generate these states as an integer value in a tag say Valve12345 where 0 = closed, 1 = fail to open  
2 = fail to close, 3 = open.

I can then drag and drop the valve tag onto the instance of the template and this works great.

Now I would like to be able to open a popup window by clicking on the symbol on the graphic with buttons to say open and close the valve. I would like to bind these buttons to tags based upon the tag that was dropped onto the instance of the template.

EG the open button would be bound to tag Valve12345Open  
and the closed button to tag Valve12345Close

Can you advise how this may be achieved.

---

<div class="post-metadata">

**Author:** ![nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@nathan](https://forum.inductiveautomation.com/u/nathan)\
**Post date:** [April 10, 2012, 12:08pm UTC](https://forum.inductiveautomation.com/t/indirection-and-templates-for-valve-animation-and-control/4269/2 "2012-04-10T12:08:32Z")

</div>

Have you seen the “Design like a Pro” webinar series? The second half of the second video provides an example that is very similar to what you’re asking for.

[youtube.com/watch?v=hbgJRlxAVgY](http://www.youtube.com/watch?v=hbgJRlxAVgY)  
[youtube.com/watch?v=V8LGl7JSNLE](http://www.youtube.com/watch?v=V8LGl7JSNLE)

---

<div class="post-metadata">

**Author:** ![hensoa](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@hensoa](https://forum.inductiveautomation.com/u/hensoa)\
**Post date:** [April 10, 2012, 12:25pm UTC](https://forum.inductiveautomation.com/t/indirection-and-templates-for-valve-animation-and-control/4269/3 "2012-04-10T12:25:57Z")

</div>

Unfortunately our IT dept blocks access to youtube may have to view at home tonight

---

<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:** [April 10, 2012, 3:38pm UTC](https://forum.inductiveautomation.com/t/indirection-and-templates-for-valve-animation-and-control/4269/4 "2012-04-10T15:38:25Z")

</div>

What you should do is add a template parameter called tagpath that is a string. Don’t expose the integer value as a parameter (this is what you have right now since you drag the tag onto it). On your graphic the color will be bound to an indirect tag using the new tagpath. That way you have the tagpath that you can pass into a popup window.
