Add TIME
ADD_TIME adds the times of the two input variables and writes the sum in the output variable.
Input
1st input: addend
2nd input: addend
Output
sum
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.
In this example the input variables time_value_1 and time_value_2 have been declared. Instead, you may enter constants directly at the input contacts of a function.
VAR
time_value_1: TIME:=T#0s;
time_value_2: TIME:=T#0s;
time_value_3: TIME:=T#0s;
END_VAR
time_value_1 and time_value_2 are added. The result is written into time_value_3.
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_TIME!,Instance,8,0,14,4,,?DTime1?DTime2?C);
B(B_VARIN,,time_value_1,6,1,8,3,);
B(B_VARIN,,time_value_2,6,2,8,4,);
B(B_VAROUT,,time_value_3,14,1,16,3,);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
time_value_3:=ADD_TIME(time_value_1, time_value_2);