Tag Archives: siemens s7 date and time format

Time and date data format in SIEMENS S7-300/400 series PLC

Data types are split into basic data types and complex data types. Data formats for time and date have both basic and complex data types.

1. Time of Day and wherein DATE belongs to the basic data types

1.1 DATE is a 16-bit data type in IEC format with a resolution of 1 day;
The format is D#1990-01-01~D#2168-12-31 or DATE#1990-1-1~DATE#2168-12-31;
It can be translated into and from INT type data. D#1990-1-1 corresponds to 1, and for every 1 increase in INT data, the DATE data value is increased by 1 day.

1.2 Time of Day is a 32-bit 24-hour time format with a resolution of 1ms
The format is TOD#00:00:00.000~TOD#23:59:59.999;
It can be translated into and from DINT type data. TOD#00:00:00.000 corresponds to 1, and Dever increases by 1 and the Time of Day time value increases by 1ms.

2. DATE_AND_TIME is a data type match
DATE_AND_TIME includes 8 bytes, the description of each byte is shown in the figure below;
The format is DT#1990-1-1-0:0:0.0 to DT#2089-12-31-23:59:59.999;

How does SIEMENS PLC set up system time?

SIEMENS PLC set up system time

There are two ways to set PLC time and real-time time synchronization.

1. In SIMATIC Manager, open the project in turn to the CPU (such as CPU 315-2DP), then right-click the CPU to select “PLC/Set Time of Day”, set the corresponding time in the interface, directly modify the CPU time and date;

2. You can also open your project in SIMATIC Manager and select the menu PLC/Diagnostic/Setting/Setting Time of Day (Diagnosis/Setting/Setting Date Time of Day). In the open interface, you can change the date of the CPU with the same settings as above.