Skip to main content

7.13.4 CONCAT_DT

Function

Combine integer data YEAR, MONTH, DAY, HOUR, MINUTE, SECOND into DT type data and output

LD graphics

CONCAT_DT

Parameter description

Interface variableDeclarationData typeDescription
YEARVar_IntDINTYear
MONTHVar_IntDINTMonth
DAYVar_IntDINTDate
HOURVar_IntDINTHour
MINUTEVar_IntDINTMinute
SECONDVar_IntDINTSecond
Function nameReturn valueDTYear, month, day + Hour, minute and second
  • Input value range YEAR:1970-2105; MONTH:1-12; DAY:1-31; HOUR:0-23; MINUTE:0-59; SECOND: 0-59. If the input value exceeds the range (DAY needs to be judged according to the month, and February needs to be judged according to whether it is a leap year), the return value is 16#0000

Example

  • An LD example is shown in the following animation:

CONCAT_DT_GIF

  • ST example is shown in the following code:
OUT:=CONCAT_DT(
YEAR:=IN1,
MONTH:=IN2,
DAY:=IN3,
HOUR:=IN4,
MINUTE:=IN5,
SECOND:=IN6
);