101BExtended instructions
8.1 Date and time-of-day
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
235
Condition codes: ENO = 1 means no error occurred. ENO = 0 and parameter OUT = 0
errors:
●
Invalid DTL value
●
Invalid Time value
Table 8- 7
T_COMBINE (combine time values) instruction
LAD / FBD
SCL
Description
out := CONCAT_DATE_TOD(
in1 := _Time_Of_Day_in,
in2 := _Time_Of_Day_in,
out => _DTL_out);
T_COMBINE combines a Date value and a
Time_of_Day value to create a DTL value.
1
Note that the T_COMBINEinstruction in the Extended Instructions equates to the CONCAT_DATE_TODfunction in SCL.
Table 8- 8
Data types for the T_COMBINE parameters
Parameter and type
Data type
Description
IN1
IN
Date
Date value to be combined must be between DATE#1990-
01-01 and DATE#2089-12-31
IN2
IN
Time_of_Day
Time_of_Day values to be combined
OUT
OUT
DTL
DTL value
8.1.2
Set and read system clock
Use the clock instructions to set and read the CPU system clock. The data type DTL
(Page 89) is used to provide date and time values.
Table 8- 9
System time instructions
LAD / FBD
SCL
Description
ret_val := WR_SYS_T(
in:=_DTL_in_);
WR_SYS_T (Write System Time) sets the CPU time of day clock with a
DTL value at parameter IN. This time value does not include local time
zone or daylight saving time offsets.
ret_val := RD_SYS_T(
out=>_DTL_out);
RD_SYS_T (Read System Time) reads the current system time from
the CPU. This time value does not include local time zone or daylight
saving time offsets.
ret_val := RD_LOC_T(
out=>_DTL_out);
RD_LOC_T (Read Local Time) provides the current local time of the
CPU as a DTL data type. This time value reflects the local time zone
adjusted appropriately for daylight saving time (if configured).