@anotherusername said in How not to count:
Does the PLC have any? Most of the ones I've used did not.
It does as far as I can tell, there actually is a DATE_AND_TIME datatype in the IEC-standard, but it seems like all the different brands just go with whatever the hell they want sometimes.
Overall, that sounds like a fairly reasonable approach if we have these assumptions:
- the system needs to record the exact date/time every time a ball passes the sensor -- maybe the designer thought that the HMI was going to allow the user to view this raw data, or that it could be useful as a future improvement
No, it does not, which is why I find the array a peculiar choice. The external systems just sums up the data and shows it per day.
- there will always be fewer than 150 events in whatever interval of time the external system polls the PLC and resets the arrays
Yeah, the event count in this case would stay under the limit (unless something extraordinary happened), though the wrap-around did not actually work which is why we started looking at the code in the first place.