Subtract TIME_OF_DAY from TIME_OF_DAY
SUB_TOD_TOD subtracts a value of the data typeTIME_OF_DAY from another TIME_OF_DAY value. The result is stored in the output variable of the data type TIME.
Input
1st input: minuend
2nd input: subtrahend
Output
Result
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_value1: TIME_OF_DAY:=TOD#18:29:59;
TOD_value2: TIME_OF_DAY:=TOD#05:21:28;
TIME_result: TIME:=T#0s;
END_VAR
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_VARIN,,TOD_value1,16,1,18,3,);
B(B_VARIN,,TOD_value2,16,2,18,4,);
B(B_VAROUT,,TIME_result,26,1,28,3,);
B(B_F,SUB_TOD_TOD!,Instance,18,1,26,4,,?D?D?C);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
TIME_result := SUB_TOD_TOD(TOD_value1, TOD_value2);