PLC5 clock changing

frw312

Member
Join Date
Jun 2005
Posts
85
Having an interesting problem. On a plc5 the hour word (S:21) changes during the night by 12 hours. This has happened twice in the last week. We reset the word to the correct time and the next morning it is off by 12 hours and the minutes (S:22) are correct. I would expect the battery to keep clock right if power was lost to the plc. The fact minutes are correct and only hours changes points to something changing the hour word. There isn’t anybody with programming experience enough to be changing during the time shift is down. To the best of my knowledge there is no HMI logic writing to plc address that affect time. Any ideas? This is a puzzle.
 
Just a thought.... Are you setting it using a 24 hour time format?
ie, its 2:00 pm and you set the hours to 2 instead of 14. Next morning at 8 am your clock reads 20.

Its happened before. DAMHIKT. 🍺

Aside from that double check your PLC program for instances where the program writes to S:21 and also double check again to see if the HMI or another PLC on the network is writing to it.
 
Last edited:
It is set up to 24 hour clock so 8 AM shows 20 in word S:3:21.

I did a “find all” on S:21 and there is only 1 place where the word was being set from a global bit from another plc. The bit in the other plc is forced off and has been so for awhile. I did a test on that rung yesterday and verified that it isn’t being written too.

As far as HMIs writing I can find nothing being written but I haven’t ruled that out completely yet as I did not originally write those HMIs and I am still going through them. The odd part is this problem has only showed up in the last week.

Is there any known hardware issue with the PLC5 that does this?
 
Bernie,

You are right my discription wasn't clear. At 8 am this morning it was 20 making the logic think it was 8 pm. normally at midnight the lights turn off, they have been going off at noon. thats what got our attention. As long as i reset it we're good till tommorrow. I am going to build some logic to see what time the hour data gets corrupted. frw
 
right, i must be brain dead. Anyway there is no DST logic in the plc or system to my knowledge.
 
Expectantly awaiting the results of your 'when does it change?' tests. But of course you won't be able to use the PLC real time clock to document that (somewhat of a 'Catch-22'* isn't it?)

* a term from a novel with the same title by Joseph Heller (for those unsure about DST)
 
The logic I put in looks to see when S:21 is NEQ to what is was the last time it changed and when that condition is true I move the value in S:21 and S:22 to FFLs and then move the values to the words to compare for the NEQ block.. If everything is right I should see the hours change in sequence and the minutes should always be 0. If the number gets hammered then I know the last time it was right and at least have an idea when the problem occurs. The next thing is to figure out why. frw

ps i haven't read the book was a least i knew what that term meant. LOL
 
Post your .RSP file maybe someone can spot something. Zip it first then post. If you can of-course.
 
I would poat the .rsp but the company I am consulting for won't allow that. thanks thou, frw
 
The bit triggering the write is forced off? Is that bit an Input bit or an Output bit? If it is an Output bit, forcing an output won't affect the logic and the write could still occur. Forcing an output only affects the output not the logic.

OG
 
The bit triggering the write is forced off? Is that bit an Input bit or an Output bit? If it is an Output bit, forcing an output won't affect the logic and the write could still occur. Forcing an output only affects the output not the logic.

OG

not sure how this applies to this thread. Please clarify, thanks
 

Similar Topics

hi all, i have 16 lines here and almost all are identical. each has a steel seam belt to transport product on. each belt stretches and must be...
Replies
8
Views
2,351
Is anyone using RSView or Wonderware to set the clocks in a PLC5. If so, how?
Replies
3
Views
3,577
DaMan
D
can anyone tell me if an allen bradley PLC5 (i think its a '/40') has a clock, and/or if it has a function to access the minute and hour. or...
Replies
2
Views
3,281
I am using the following formula and I am getting error, Invalid Expression - too many closing parenthesis. when i copy the formula to notepad or...
Replies
4
Views
143
Back
Top Bottom