2 State Toggle Button not functioning properly

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.

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

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?

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.

2 Likes