Hello,
Currently, I have a setup where I am reading some tag information from the PLC, such as scanner statistics. For each tag, I have a Value Changed script where I count the change in tag value, as shown in the image below:
The HourlyCount
is reset every 30 minutes, and the DailyCount
is reset every day at 12:00 AM. I use a gateway script to reset these values. Additionally, based on the PLC's local time, the tag values themselves are sometimes reset to 0
.
The issue I'm facing is that occasionally, the HourlyCount
and DailyCount
are taking the raw value of the PLC tag(where Hourly Count is 12345678) instead of calculating the increment between the previous and current values. Normally, the count should increment by 1, as the PLC tag value typically increases by 1.
Is there anything wrong with this logic?