Siemens S7/TIA v18: Wall clock time (again)...

Mas01

Member
Join Date
Oct 2020
Location
Leicester, England
Posts
1,109
This old chestnut again...

Our clocks (UK) went back an hour yesterday.

Now the time displayed on the HMI is 1hr behind what it should be.

In the picture attached, "dtlNow" is calculated by calling RD_SYS_T.

Can I insert an "ADD" block after RD_SYS_T to make the adjustment (i.e. add -1 or +1 to make the adjustments?

Or is there a neater way to solve this twice-yearly recurring problem?

Thanks

time should be 14-10.png
 
I don't think system time changes, just local time. If you use RD_LOC_T you should get the correct value.

The default HMI time/date tags can only be set to system time that I've found. I've got around that by manually assigning a tag generated from the RD_LOC_T block.
 
Silly question, is that time zone correct? I was expecting you to be at UTC +0, not +1
 
I don't think system time changes, just local time. If you use RD_LOC_T you should get the correct value.

The default HMI time/date tags can only be set to system time that I've found. I've got around that by manually assigning a tag generated from the RD_LOC_T block.

Oh, I didn't even know there was an instruction called RD_LOC_T.

I'll give it a try.

BTW, I changed the Time of Day configuration to "London", if that makes any difference. See pic: (yes, @mk42, timezone was incorrect in first picture)

ToD UTC London.png
 
Silly question, is that time zone correct? I was expecting you to be at UTC +0, not +1

Daylight savings look correct from the screenshot. We changed from BST (UTC+1) to GMT (UTC+0) yesterday.

EDIT: I mean, half of them do! UTC+1 was correct last week, but yesterday was the last sunday in October.
 
Last edited:
Hmm

I changed timeszone to London

And I'm now calling RD_LOC_T. Re-compiled, but the monitored time is now 2 hrs ahead of what it should be.

monitored time is 2 hrs ahead.png
 
Last edited:
Have you done a hardware download? Anything in the settings of the PLC on the device configuration page classes as a hardware change.

I've just checked a live program and my system time and local time are both reading the same value, which is the correct time. Mine is also set to That London time.
 
Have you done a hardware download? Anything in the settings of the PLC on the device configuration page classes as a hardware change.

I've just checked a live program and my system time and local time are both reading the same value, which is the correct time. Mine is also set to That London time.
I knew this would catch me out (@mk42 has warned me about this previously).

Also, per the online Help, I see that the integer output from the block should be "1" (not "0") if local time is being output.

Let me give it a try.
 
Hmm

I changed timeszone to London

And I'm now calling RD_LOC_T. Re-compiled, but the monitored time is now 2 hrs ahead of what it should be.


My guess is that when you set it originally, you "built in" the time zone when you set the system time, and now that you have fixed the time zone at the same time as you switch to looking at local time, it's now another hour off.


Or the opposite of that. My brain broke a little bit when I was was trying to do the time math without writing it all down, and time math isn't fun enough to break out the scratch pad and dive in.
 

Similar Topics

Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi again, When the "REPORT" button is pressed (on a different screen), it takes the operator to the...
Replies
7
Views
666
Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi, The operator has reported that, from time-to-time, when he presses the "Generate Report" button...
Replies
5
Views
465
General Question: The PLC and HMI that I've been working on (a laser measurement system) is soon to be transported to the site where it will be...
Replies
2
Views
701
Hi, I'm not sure how to do this... Basically, I want to restrict the user input values for this tag to be in the range 20.001 to 25.0. I...
Replies
17
Views
1,634
Can someone help me with this? I'm no good at SCL - virtually everything I've done so far has been ladder logic. The return value from the...
Replies
13
Views
1,108
Back
Top Bottom