I have a tag called DailySweeps that has an integer values and is counting the number of sweeps a machine makes during the day. There is a 2nd tag called ResetSweeps that is currently False. When ResetSweeps goes True, the value of DailySweeps is reset to zero. This normally happens once a day, but could happen several times per day depending on production. I would like to capture the sweep count before it is reset. I am thinking that what I need is an action item that will write an alert to the alert table with the value of DailySweeps when ResetSweeps goes True.
Is this the correct way to go about this type of problem? If so, do I have to worry about DailySweeps be reset before I get the value? Also I have never written an action item before, so if you could give me a jumbo type coding hint, I would appreciate it.
I was originally going to do this in SQL, but I thought it may be much easier to handle in FSQL.