ADD_DT_TIME

Add TIME to DATE_AND_TIME

ADD_DT_TIME adds the value of a variable of the data type TIME to the date and time stored in the variable of the data type DATE_AND_TIME. The result is stored in a variable of the data type DATE_AND_TIME.

Parameters

Input

Unnamed input (DATE_AND_TIME)

1st input: augend

Unnamed input (TIME)

2nd input: addend

Output

Unnamed output (DATE_AND_TIME)

sum

Example

POU header

All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.

	VAR
		DT_value: DATE_AND_TIME:=DT#2011-12-24-18:29:59;
		TIME_value: TIME:=T#2h35m38s560ms;
		DT_result: DATE_AND_TIME:=DT#2001-01-01-00:00:00;
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
B(B_F,ADD_DT_TIME!,Instance,18,1,26,4,,?D?D?C);
B(B_VARIN,,DT_value,16,1,18,3,);
B(B_VARIN,,TIME_value,16,2,18,4,);
B(B_VAROUT,,DT_result,26,1,28,3,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

DT_result := ADD_DT_TIME(DT_value, TIME_value);

Modified on: 2019-01-25Feedback on this pagePanasonic hotline