I know the following will probably need some amount of scripting I am just curious of ease and implimentation.
In FSQL I recently made a group for what I will refer to as hourly counts. Every hour on the hour it sends a signal to all the PLC units to send in and store the result they have at that current time. I also have it claused to watch the logged in status bit. If no one is logged into that machine or if that machine is not available online then it will not signal those units. This SQL query works quite well. But it has one draw back that I did not plan on. Lets say at 1:55 the machine shut off with a fault. The mechanic is working on it but it is still not running at 2:00 when the hourly fires off. At this time the PLC is going to send the same data it sent at 1:55. So it will record the fault again. Now when you go into the status screen I have setup the fault count will be incorrect. So in this scenario the faults and some of the other historical data could be off by upto 12 counts. Figure 12 hour shift if it were to happen at every hour for the duration of the day. I am not sure how this will affect production. So I am thinking ahead.
The two theories that I came up with that could solve the problem is as such and I wanted to post them and see what the general consensus is.
After the machine goes from a start to a stop, and the software has collected the data. Send a clear command to the PLC to clear out the fault codes and such. This way if it does trigger again it will not record any additional fault information.
After the machine goes from a start to a stop monitor the run stop bit which is reported back to the SQL table. If the signal for hourly is given and this status bit has not changed just duplicated the last entry for that machine center.
Unless someone has a better different way to look at it. Would appreciate hearing some feedback.
HAPPY NEW YEAR!!!
Have a great day.