I have OPC Tags (TCP Drivers) that add the incoming data into a MS SQL Table every time the Value Changed Tag Event fires. This works great 99% of the time. Sometimes, the value will get written to the database again though. This definitely happens any/every time I go into the Tag Event Value Changed screen, and end up clicking OK, or Apply (regardless if I made any changes or not). Now I understand why it’s doing it at these times, but what I’m wondering is how can I clear the tag’s value after my code executes? I’m already checking to see if currentValue == None at the very beginning. But how can at the end of my code, I set currentValue to None so that it can’t execute again unless the value truly did change? I’ve tried several methods of writing to the tag itself, and nothing seems to error out, but nothing seems to work either. I’m obviously reading the “Message” field from the OPC Item Path. I need to be able to clear out the “Message” field I’m guessing.
Any help would be greatly appreciated…
Thanks in advance!