Hello,
So I noticed that my plant run timers, as seen on the HMI screen are resetting every day at 2300 hours instead of at 0 ( Instead of at Midnight). So the PLC logic is OFF by an hour somwhere. The PLC logic is using the WallClockTime object and extracting, using the GSV instruction, the LocalDateTime attribute. See attached Screen Shot. As of the date of this post, we are currently in Daylight Savings Time.
In addition, I see the DSTAdjustment attribute being used and currently has a value of 60 minutes.
If we are currently in DST, then the PLC logic ADDs a value of 1 to the hour from RunTime_TimeDate[3], this value is then written to the RunTime_Hour tag. If we are NOT is DST, then it does not add a 1. Then if the RunTime_Hour equals either 0 or 24 ( Indicating Midnight in standard time and DST respectively) then our Plant Run Timers will reset. See attached Screen Shot.
A couple of questions:
1)Where does the 60 minutes value get written from to the DSTAdjusment attribute? Is this done automatically by the PLC. I can't imagine that it does.
2) I don't think based on the current logic, that the logic is properly resetting the run timers at midnight and taking DST into account.
Any thoughts on where the problem might be?
So I noticed that my plant run timers, as seen on the HMI screen are resetting every day at 2300 hours instead of at 0 ( Instead of at Midnight). So the PLC logic is OFF by an hour somwhere. The PLC logic is using the WallClockTime object and extracting, using the GSV instruction, the LocalDateTime attribute. See attached Screen Shot. As of the date of this post, we are currently in Daylight Savings Time.
In addition, I see the DSTAdjustment attribute being used and currently has a value of 60 minutes.
If we are currently in DST, then the PLC logic ADDs a value of 1 to the hour from RunTime_TimeDate[3], this value is then written to the RunTime_Hour tag. If we are NOT is DST, then it does not add a 1. Then if the RunTime_Hour equals either 0 or 24 ( Indicating Midnight in standard time and DST respectively) then our Plant Run Timers will reset. See attached Screen Shot.
A couple of questions:
1)Where does the 60 minutes value get written from to the DSTAdjusment attribute? Is this done automatically by the PLC. I can't imagine that it does.
2) I don't think based on the current logic, that the logic is properly resetting the run timers at midnight and taking DST into account.
Any thoughts on where the problem might be?