ADD_TOD_TIME

Add TIME to TIME_OF_DAY

ADD_TOD_TIME adds a variable of the data type TIME to the time of day. The result is stored in a variable of the data type TIME_OF_DAY.

Parameters

Input

Unnamed input (TIME_OF_DAY)

1st input: augend

Unnamed input (TIME)

2nd input: addend

Output

Unnamed output (TIME_OF_DAY)

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
		TOD_value: TIME_OF_DAY:=TOD#18:29:59;
		TIME_value: TIME:=T#2h35m38s560ms;
		TOD_result: TIME_OF_DAY:=TOD#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_TOD_TIME!,Instance,17,1,26,4,,?D?D?C);
B(B_VARIN,,TOD_value,15,1,17,3,);
B(B_VARIN,,TIME_value,15,2,17,4,);
B(B_VAROUT,,TOD_result,26,1,28,3,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

TOD_result := ADD_TOD_TIME(TOD_value, TIME_value);

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