Forum

Notifications
Clear all

[Solved] S7-1500 time-of-day one hour off after DST, RD_SYS_T and the Comfort panel disagree

5 Posts
3 Users
0 Reactions
3 Views
(@kiran_s)
New Member
Joined: 2 years ago
Posts: 0
Topic starter   [#78]

Hello all. CPU 1511 1 PN with a TP1200 Comfort, TIA V17, site in the UK. Batch records are stamped in the PLC with RD_SYS_T into a DB, and the panel shows those stamps next to its own clock.

Since the clocks changed the PLC stamps are exactly one hour behind the panel. Before that they matched, and the panel's own clock is right, the operators go by it. I set the time from the laptop under Online & diagnostics and the stamp was still an hour off straight after, so it's an offset and not drift. Digging today I found that someone at commissioning added a fixed +1 hour in the logic after RD_SYS_T, and nobody knows why.

Is the CPU clock wrong or is the logic wrong? I'm not pulling a +1 out of live batch logic on a guess, so could someone explain what that hour was probably put there for?


Advertisement

   
Quote
(@annaz)
New Member
Joined: 8 months ago
Posts: 0
 

Does the 1500 have a battery for the clock? Maybe that's all it is. On my bench rig the 1200 loses the time when I unplug it for a weekend, and I thought that was the same thing.



   
ReplyQuote
(@kiran_s)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

It keeps the time over a power off, so this isn't a reset. It's exactly one hour, and only since the clocks went forward. NTP is fine as well, the CPU says synchronised.



   
ReplyQuote
(@hkraus)
New Member
Joined: 2 years ago
Posts: 0
 

RD_SYS_T gives you UTC. Always, on every 1500, and NTP feeds it UTC too, so that side is right. Your logic's fixed +1 was someone's way of getting local time, and it was right for exactly half the year.

Local time is a different instruction. In the CPU properties, Time of day, set the time zone to UK and tick the daylight saving rule. Then swap RD_SYS_T for RD_LOC_T in the stamp logic and delete the +1. The CPU applies the offset and the DST switch by itself, and it's in the S7-1500 system manual under the time-of-day chapter if you want the wording.

The panel was right because a Comfort panel has its own time zone setting.



   
ReplyQuote
(@kiran_s)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

Set the time zone and the DST rule in the CPU properties, swapped RD_SYS_T for RD_LOC_T, removed the +1 hour, downloaded this morning from V17. PLC stamps and the panel clock agree to the second now.

So the stamp logic was reading UTC and adding a fixed hour, which was right for half the year and wrong for the other half. The time zone in the CPU plus RD_LOC_T does it properly.

One thing I haven't checked is what the historian does with the old stamps from the last three weeks, they're all an hour out in the database. Not looking forward to that one. Thanks hkraus.



   
ReplyQuote
Share: