Concatenate INT values to form the time of day
CONCAT_TOD_INT concatenates the INT values for hour, minute, second, and millisecond. The result is stored in the output variable of the data type TIME_OF_DAY. The Boolean output ERROR is set if the input values are invalid date or time values.
Input
1st input: hour
2nd input: minute
3rd input: second
4th input: millisecond
Output
Result
The Boolean output ERROR is set if the input values are invalid date or time values.
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#00:00:00;
HOUR_value: INT:=18;
MINUTE_value: INT:=29;
SECOND_value: INT:=59;
MILLISECOND_value: INT:=0;
ERROR: BOOL:=FALSE;
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 9 ;
NETWORK_BODY
B(B_VAROUT,,TOD_value,27,1,29,3,);
B(B_VAROUT,,ERROR,27,2,29,4,);
B(B_VARIN,,HOUR_value,15,1,17,3,);
B(B_VARIN,,MINUTE_value,15,2,17,4,);
B(B_VARIN,,SECOND_value,15,3,17,5,);
B(B_VARIN,,MILLISECOND_value,15,4,17,6,);
B(B_F,CONCAT_TOD_INT!,Instance,17,0,27,6,,?DHOUR?DMINUTE?DSECOND?DMILLISECOND?C?CERROR);
L(1,0,1,9);
END_NETWORK_BODY
END_NET_WORK
END_BODY
TOD_value := CONCAT_TOD_INT(HOUR := HOUR_value,
MINUTE := MINUTE_value,
SECOND := SECOND_value,
MILLISECOND := MILLISECOND_value,
ERROR => ERROR);