Is this good practice?

I have a script that runs on the property change event to update an SQL tag. The PLC is connected wirelessly. I have it in its own scan class to account for the slower comms / latency. Most days, this is good enough to prevent overlays and errors from popping up in the writeToTag script. Some days, it is not. The script runs every few seconds and on the bad days can be quite annoying with the error popup window. My sloution was to use an ‘if’ in the script. The property change event fires as often as it did before but the writeToTag only happens ‘if’ data quality is GOOD. The way I see it, the SQL tag would not get written when data quality is BAD either way. I am preventing the server from attempting to write when it can not, saving some unnecessary comms. Any issues with this method?

Shawn

Others may chime in, but that sounds like a valid solution to me.

I do the same sort of thing with some of my transaction groups, since they want us to kill the mains on some of our machines-- as if a few PLCs not running offsets the three constantly running 150hp air compressors… :unamused: