Download this file
1 2 3 4 5 6 7 8 9 10 11 12 13 14
FUNCTION NTP_DATA_TO_DT : DT VAR_INPUT // Packet re u du serveur NTP abyNtpResponse: ARRAY [0..47] OF BYTE; // Fuseau horaire UTC iUtcOffset: INT(-12..14) := 3; END_VAR VAR // Variable pour caclul dwNtpServerTime: DWORD; liNtpServerTime: LINT; VAR CONSTANT NTP_DATA_TO_DT := LINT_TO_DT (liNtpServerTime - c_dwNtpToUnixTimeOffset + iUtcOffset * c_usiMinutesPerHour * c_usiSecondsPerMinute);