# Controling a valve through a faceplate

**URL:** <https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 17, 2023, 12:01pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524 "2023-04-17T12:01:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukas\_De\_Cleen](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Lukas\_De\_Cleen](https://forum.inductiveautomation.com/u/Lukas_De_Cleen)\
**Post date:** [April 17, 2023, 12:01pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/1 "2023-04-17T12:01:29Z")

</div>

Hey, I am trying to make a faceplate for a valve in perspective. I already manged to read values from my PLC, but when i make a button for opening or closing the valve i just doens't work. I work with parameters, i link my PLC tags with parameter.

---

<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:** [April 17, 2023, 12:06pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/2 "2023-04-17T12:06:44Z")

</div>

Did you make the parameters bidirectional? Is the view embedded with the outer view's parameters bidirectionally bound to the tag?

Consider not using parameters for the tag value, but instead passing a tag path as a string parameter, pointing to the tag to be controlled, or to the folder/UDT instance containing the relevant tags. Then, your faceplate view can use an indirect binding set to bidirectional.

---

<div class="post-metadata">

**Author:** ![Lukas\_De\_Cleen](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Lukas\_De\_Cleen](https://forum.inductiveautomation.com/u/Lukas_De_Cleen)\
**Post date:** [April 17, 2023, 12:25pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/3 "2023-04-17T12:25:38Z")

</div>

Yeah i put them on bidriectional. I will try the tag path method. Thanks for replying!

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [April 17, 2023, 3:37pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/4 "2023-04-17T15:37:00Z")

</div>

Did you get it to work?  
I am not an expert, but I have made some faceplates for valves, using different methods.  
pturmel is an expert! He helped me.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [April 17, 2023, 4:00pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/5 "2023-04-17T16:00:40Z")

</div>

Assuming you expect this button to only ever toggle the state of the valve from open to closed or from closed to open, you could do this as your script (assuming the button and valve are siblings):

```auto
def runAction(self, event):
	self.getSibling("Valve").props.state = "open" if self.getSibling("Valve").props.state == "closed" else "closed"

```

---

<div class="post-metadata">

**Author:** ![Lukas\_De\_Cleen](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Lukas\_De\_Cleen](https://forum.inductiveautomation.com/u/Lukas_De_Cleen)\
**Post date:** [April 18, 2023, 8:41am UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/6 "2023-04-18T08:41:51Z")

</div>

Yeah i tested it and it worked!

---

<div class="post-metadata">

**Author:** ![Lukas\_De\_Cleen](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Lukas\_De\_Cleen](https://forum.inductiveautomation.com/u/Lukas_De_Cleen)\
**Post date:** [April 18, 2023, 8:42am UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/7 "2023-04-18T08:42:01Z")

</div>

Thanks it worked!

---

<div class="post-metadata">

**Author:** ![Lukas\_De\_Cleen](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Lukas\_De\_Cleen](https://forum.inductiveautomation.com/u/Lukas_De_Cleen)\
**Post date:** [April 18, 2023, 8:45am UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/8 "2023-04-18T08:45:09Z")

</div>

No i want to use two separate buttons, one to close and one to open the valve.

---

<div class="post-metadata">

**Author:** ![Simen\_Minerd](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Simen\_Minerd](https://forum.inductiveautomation.com/u/Simen_Minerd)\
**Post date:** [April 18, 2023, 2:09pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/9 "2023-04-18T14:09:49Z")

</div>

What kind of Valve do you have? What is the valve for?  
Perspective has built in multi-state-button.  
The can tight an INT to this button; you can also change it to 2 positions; it is like a selector, not really a push button.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/f/3f3660d9b6a5567127c25952e4fb1134f631f3e7.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/7/c7b12869a18b470bfa49903a0d237955e8446124.png)

---

<div class="post-metadata">

**Author:** ![Lukas\_De\_Cleen](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Lukas\_De\_Cleen](https://forum.inductiveautomation.com/u/Lukas_De_Cleen)\
**Post date:** [April 18, 2023, 2:12pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/10 "2023-04-18T14:12:09Z")

</div>

It is a solenoid operated valve. In the PLC logic it is controlled through a PlantPax 3.5 addon. I am trying to recreate the PlantPax library in perspective.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 18, 2023, 6:44pm UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/11 "2023-04-18T18:44:43Z")

</div>

> [@Lukas\_De\_Cleen](#):
>
> PlantPax library in perspective.

Yuck!

Have you looked at this:

> [@Introducing Flintium! An open source library of Ignition faceplates](https://forum.inductiveautomation.com/t/introducing-flintium-an-open-source-library-of-ignition-faceplates/36302):
>
> I’ve been working on this library for a while now, and just made the repository public. Originally based on the [FactoryPacks](https://inductiveautomation.com/exchange/113/overview) project from the Ignition Exchange. Once Flintium is stable, a version will be posted to the Exchange, but for now, feel free to try out the working version on Github. The project needs input from this community! For information on contributing, please see the [Contributing](https://github.com/jlbcontrols/Flintium/wiki/Contributing) Wiki page. Anyone is welcome to post comments, feature requests, and report bugs on the [issues pa…](https://github.com/jlbcontrols/Flintium/issues)

---

<div class="post-metadata">

**Author:** ![Lukas\_De\_Cleen](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Lukas\_De\_Cleen](https://forum.inductiveautomation.com/u/Lukas_De_Cleen)\
**Post date:** [April 19, 2023, 7:04am UTC](https://forum.inductiveautomation.com/t/controling-a-valve-through-a-faceplate/72524/12 "2023-04-19T07:04:11Z")

</div>

Yes i did but it is only for vision and i need to do it in perspective.
