# 2 State Button Reset

**URL:** <https://forum.inductiveautomation.com/t/2-state-button-reset/27460>\
**Category:** Ignition\
**Created:** [August 15, 2019, 12:03am UTC](https://forum.inductiveautomation.com/t/2-state-button-reset/27460 "2019-08-15T00:03:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jragonesi](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jragonesi](https://forum.inductiveautomation.com/u/jragonesi)\
**Post date:** [August 15, 2019, 12:03am UTC](https://forum.inductiveautomation.com/t/2-state-button-reset/27460/1 "2019-08-15T00:03:07Z")

</div>

Is there a way to reset the Control Value on a 2-state button so that a toggle on/off request does not persist? For example, an operator requests a Valve to open but the controller denies this request and the Indicator Value stays 0. The Control Value will persist at 1 until the Indicator Value goes to 1. Is there a way to reset the Control Value after an elapsed period of time if the Indicator Value does not change?

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [August 15, 2019, 11:58am UTC](https://forum.inductiveautomation.com/t/2-state-button-reset/27460/2 "2019-08-15T11:58:21Z")

</div>

Could use momentary push-buttons for issuing control value requests and a multi-state indicator for the actual indicator value… Unless you need to keep the control value request signal high if successful and only reset on failures. In that case you could use a timer component with an event script to set the control value tag back to the current value.

If you’re able to change the control logic, why not have it reset the requested control value on rejection?

Another strategy useful for ‘mode’ type settings is to have the control logic provide an array or binary enum of ‘acceptable’ or ‘available’ modes. In your HMI you configure components that will only issue writes for those modes.

---

<div class="post-metadata">

**Author:** ![jragonesi](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jragonesi](https://forum.inductiveautomation.com/u/jragonesi)\
**Post date:** [August 15, 2019, 3:43pm UTC](https://forum.inductiveautomation.com/t/2-state-button-reset/27460/3 "2019-08-15T15:43:21Z")

</div>

> If you’re able to change the control logic, why not have it reset the requested control value on rejection?

This is exactly what I'm trying to accomplish. My use case:

1. User Toggles a Control Value from FALSE to TRUE...
2. PLC rejects Control Value request due to Interlock or Alarm
3. Indicator Value remains FALSE due to PLC rejection
4. Control Value write times-out and goes back to FALSE

In reality 1-3 are happening like above but:

1. Control Value continues to write TRUE
2. Interlock or Alarm is eventually defeated
3. Valve unexpectedly opens because Control Value is still writing TRUE

It sounds like I need the PLC to reset the control value which is definitely possible but will take some time. I was hoping to fix this on the Front End instead.

---

<div class="post-metadata">

**Author:** ![sbrannen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbrannen/32/3459_2.png) [@sbrannen](https://forum.inductiveautomation.com/u/sbrannen)\
**Post date:** [August 15, 2019, 8:39pm UTC](https://forum.inductiveautomation.com/t/2-state-button-reset/27460/4 "2019-08-15T20:39:38Z")

</div>

Hi Jragonesi…

You could create a new scan class (off a copy of the default scan class). The only difference is that you will check the option **OPC Read After Write**. Assign this new scan class to the OPC tag bound to your toggle. This will immediately issue a read after write to the PLC to confirm what the bit is set to and will change your tag based on that value.

As you were…  
Steve

---

<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:** [August 15, 2019, 9:09pm UTC](https://forum.inductiveautomation.com/t/2-state-button-reset/27460/5 "2019-08-15T21:09:13Z")

</div>

You could set the enable property to the valve permissives to prevent the toggle.

A property change script to monitor when it’s disabled, and set the control value to 0, for a sanity check:

```python
if event.propertyName == 'enabled':
	if event.newValue == 0:
		event.source.controlValue = 0

```

That said, it is much better to handle this sort of thing in the PLC.
