# Most efficient use of OPC Pushbuttons

**URL:** <https://forum.inductiveautomation.com/t/most-efficient-use-of-opc-pushbuttons/88149>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [April 1, 2024, 2:14pm UTC](https://forum.inductiveautomation.com/t/most-efficient-use-of-opc-pushbuttons/88149 "2024-04-01T14:14:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [April 1, 2024, 2:14pm UTC](https://forum.inductiveautomation.com/t/most-efficient-use-of-opc-pushbuttons/88149/1 "2024-04-01T14:14:18Z")

</div>

1. Momentary with a fast tag group?

2. One Shot with the PLC resetting

3. Standard with an On Action Script to write the Tag and have the PLC reset.  
a. Custom Property bound to OPC tag and set Custom Property to 1  
b. Use Write Blocking of the tag  
c. Use System.opc write to the tag

I like 2 for the simplicity, but dislike the way the button changes state with dashed lines to show that it's 'writing'. Even changing the text to the same as the static button label, I still find the hashed lines distracting for an operator.

I've been using 3a so far as I like to keep my widgets with exposed properties for maintenance purposes. I dislike having to search through scripts to see where something is done.

I dislike 1 due to OPC failures and 'sticky' buttons. Another question, however, is that can you use a momentary with the PLC still resetting the button? I've used that combo in other HMIs with no issues, but reading through some historical posts, it seemed like the PLC resetting the OPC tag before the OPC server acknowledged the write could cause some issues.

---

<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 1, 2024, 2:24pm UTC](https://forum.inductiveautomation.com/t/most-efficient-use-of-opc-pushbuttons/88149/2 "2024-04-01T14:24:21Z")

</div>

I recommend "3a", from those choices. (Set the bidirectionally bound custom prop to jython `True`, not `1`, if you wish to be faithful to the real datatypes typically exposed.)

However, I recommend:

1. Like 2 or 3a, but have the PLC **echo** the bit to another tag. Have a gateway tag change event monitor that, and when True, reset the button bit. That ensures the bit is **on** for one OPC round trip, but no more. This typically make the timing compatible with option #2. And it implements my regular advice to only write variables from one direction.

---

<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 1, 2024, 2:25pm UTC](https://forum.inductiveautomation.com/t/most-efficient-use-of-opc-pushbuttons/88149/3 "2024-04-01T14:25:38Z")

</div>

> [@robertm](#):
>
> Another question, however, is that can you use a momentary with the PLC still resetting the button?

Generally yes, and for problematic momentary buttons, probably a good idea. (You must be using Vision, as Perspective doesn't **have** a momentary button.) But if you are going to reset elsewhere, just use a Standard button. (KISS)

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [April 1, 2024, 4:11pm UTC](https://forum.inductiveautomation.com/t/most-efficient-use-of-opc-pushbuttons/88149/4 "2024-04-01T16:11:37Z")

</div>

I like #2 except just use a typical button. Having the PLC reset the command is simple and clean IMO.

---

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [April 1, 2024, 4:37pm UTC](https://forum.inductiveautomation.com/t/most-efficient-use-of-opc-pushbuttons/88149/5 "2024-04-01T16:37:07Z")

</div>

Yes sorry, Vision.....I keep forgetting to specify that.

---

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [April 1, 2024, 4:38pm UTC](https://forum.inductiveautomation.com/t/most-efficient-use-of-opc-pushbuttons/88149/6 "2024-04-01T16:38:53Z")

</div>

That would be any of the option 3's then, since the typical button doesn't have a value property. You could use the set tag feature in scripting, but I prefer creating a custom value property for that purpose.
