Persistent Tag Issue and Forced Value in PLC After Script Execution

Hello,

I have encountered an issue with a script I created for a button to reset an alarm. Initially, I wrote the following script:
import time
system.tag.write("[default]IS15_Overheight_Rst_PB", 1)
time.sleep(1)
system.tag.write("[default]IS15_Overheight_Rst_PB", 0)

After running this script, the normally open contact remained pressed, and the tag continued to force a value of "1", despite the script having completed. I attempted to resolve the issue by deleting the script and the tag, but the problem persisted.

In an attempt to fix this, I recreated the tag under a different path and adjusted the script as follows:

import time
system.tag.write("[default]OVERHEIGHT TAGS/IS 15 Tag", 1)
time.sleep(1)
system.tag.write("[default]OVERHEIGHT TAGS/IS 15 Tag", 0)

Now, the new tag appears locked and continues to force the "1" on my PLC. Could you provide guidance on how to resolve this issue and ensure that tags do not continue to enforce unwanted values after script execution?

Please see Wiki - how to post code on this forum and then use the pencil icon link to edit and fix. Thanks!

This has been discussed many times on the forum. You can't rely on web-based HMI to turn off the tag and the use of sleep() is an indication that your logic is bad. You shouldn't use it.

Instead,

  • Have the button set a bit in the PLC.
  • Have the PLC reset the bit when the task is done.
  • Have the Perspective indication tied to the PLC bit.
import time
system.tag.write("[default]IS15_Overheight_Rst_PB", 1)
time.sleep(1)
system.tag.write("[default]IS15_Overheight_Rst_PB", 0)

i deleted and but still having the same issue it keep, then i added the tag again and still showing 1 when is suppose to be "zero" i want to put everything back the way it was can you please help me with this?
Capture

Enable read-write

Enable read-write.
Then edit your tag value.

You didn't fix your original post as requested.

sorry for the misunderstanding. but, after i did the script and deleted everything i try to bring back the same tag. the value is set two 1 when is supposed to be zero. i enable read-write and still have the same issue. who do i disable the script?

Disable or delete the script wherever you created it. You said it was on a button so that would be in the button's Configure Events. (Right-click on the button → Configure Events.)

I did it and I delete the script and then delete the tag and save the changes and still is showing 1. I brought back the tag again and it goes automatically to 1. the value is stuck in 1.

Tag to zero

If that doesn't work there is something turning it on somewhere else or in your PLC.

that happend exactly after i did the script. so can i just download the most recent backup on my plc and that might fix this issue. I heard from a coworker that doing the momentary button might latch the plc. he told me he saw it in the post office with panelview. please advice?

so can i just download the most recent backup on my plc and that might fix this issue.

You can try, but that's not the problem unless you have changed the PLC code.

I heard from a coworker that doing the momentary button might latch the plc.

Not likely.

Yes, Panelviews can experience this problem (with ordinary TCP/IP-based drivers), though much more rare than for a browser. Some reading:

https://forum.inductiveautomation.com/search?q=momentary%20button%20stuck%20order%3Alatest