# 2 State Toggle Button not functioning properly

**URL:** <https://forum.inductiveautomation.com/t/2-state-toggle-button-not-functioning-properly/56664>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [March 1, 2022, 1:57pm UTC](https://forum.inductiveautomation.com/t/2-state-toggle-button-not-functioning-properly/56664 "2022-03-01T13:57:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_Ross](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Aaron\_Ross](https://forum.inductiveautomation.com/u/Aaron_Ross)\
**Post date:** [March 1, 2022, 1:57pm UTC](https://forum.inductiveautomation.com/t/2-state-toggle-button-not-functioning-properly/56664/1 "2022-03-01T13:57:32Z")

</div>

The Problem:  
I am using multiple 2 state toggle buttons, and all of them are functioning unexpectedly. When opening the window containing my 2 state toggles, their Current State property is given an incorrect value resulting in displaying incorrect information.

My Setup:  
I am using the same PLC tag for the Indicator Value and Current State properties, however the Control Value property is tied to a different PLC tag. All 3 bindings are indirect. I also have the State 1 Value and State 2 Value properties both set to 1. This is because the press of a button should change the Control Value to 1 but a subsequent push does not reset it to 0. The PLC tag is reset to 0 using a different process.

---

<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:** [March 1, 2022, 4:39pm UTC](https://forum.inductiveautomation.com/t/2-state-toggle-button-not-functioning-properly/56664/2 "2022-03-01T16:39:59Z")

</div>

> [@Aaron\_Ross](#):
>
> The PLC tag is reset to 0 using a different process.

Don't do this. You will have race conditions and flakiness anywhere a tag is written from two directions.

---

<div class="post-metadata">

**Author:** ![Aaron\_Ross](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Aaron\_Ross](https://forum.inductiveautomation.com/u/Aaron_Ross)\
**Post date:** [March 1, 2022, 5:05pm UTC](https://forum.inductiveautomation.com/t/2-state-toggle-button-not-functioning-properly/56664/3 "2022-03-01T17:05:24Z")

</div>

The PLC tag is set to 0 within the PLC and is not a SCADA control in Ignition.  
Am I correct in assuming that this would not cause the Current State property to read an incorrect value?

---

<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:** [March 1, 2022, 5:10pm UTC](https://forum.inductiveautomation.com/t/2-state-toggle-button-not-functioning-properly/56664/4 "2022-03-01T17:10:34Z")

</div>

Not sure. Toggle buttons toggle the control value (in both directions) using a state machine. If you can’t change the PLC, don’t use a toggle button. Use a regular button with a script that writes “1” to the tag.
