Hello,
i want to store the current lokal time in a variable, to later transfer it to the target system/plc.
Im tried using DTgetTime and UtcDTGetTime but somehow i store the PLC time in this variable and not the system time.
So i want to know, if and how so, do i access the lokal time and store it in a variable?
Thank you in advance!
Hi Victor,
DTgetTime and UtcDTGetTime function blocks always will show you the time of the target where are running on (the time of the PLC).
The time shown on the left part of Online Info windows is the time of your laptop/PC, you cannot read the local time of your laptop from the PLC. This is only available from Automation Studio when you are connected to the PLC.
Online info - Date / Time
If you want to synchronize the time of your PLC online, you can synchronize it with a NTP server on the network. Just configure the IP address of the NTP server on the configuration of the PLC.
CPU properties - Time synchronization (NTP)
2 Likes