Write on change

I have a machine connected to my Ignition system that we are using a photo eye to count pallets as they go by. I have the history of the tag set up like this:

What I want to happen is every time the tag changes value I want that value to be written to MSSQLDatabase. As I began writing this I noticed the value mode and that I have it set to analog. I have since changed it to discrete and the results are the same. Some of the data comes back to SQL but not all. I assume I need to use a client change event script. I am in the process of learning how to code in python (or any text based code for that matter) but have just begun that. What function would I need to use? Some ideas on the syntax of the script would also be helpful. Thanks

Also set your deadband to zero. Do keep in mind that it cannot record faster than the device is being polled by your driver. You may need a different scan class with a faster rate.

{added the Ignition 7.9 tag so you hopefully don't get answers targeted at Ignition 8}

1 Like

Thanks Phil! I was over complicating it. It was the scan class.

Thanks so much but it's actually 7.8

There ya go.