Split TIME_OF_DAY into INT values
SPLIT_TOD_INT splits a value of the data type TIME_OF_DAY into INT values for hour, minute, second, and millisecond.
Input
time of day
Output
hour
minute
second
millisecond
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;
HOUR_value: INT:=0;
MINUTE_value: INT:=0;
SECOND_value: INT:=0;
MILLISECOND_value: INT:=0;
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_VARIN,,TOD_value,13,1,15,3,);
B(B_VAROUT,,HOUR_value,24,1,26,3,);
B(B_F,SPLIT_TOD_INT!,Instance,15,0,24,6,,?DIN?CHOUR?CMINUTE?CSECOND?CMILLISECOND);
B(B_VAROUT,,MINUTE_value,24,2,26,4,);
B(B_VAROUT,,SECOND_value,24,3,26,5,);
B(B_VAROUT,,MILLISECOND_value,24,4,26,6,);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
SPLIT_TOD_INT(IN := TOD_value,
HOUR => HOUR_value,
MINUTE => MINUTE_value,
SECOND => SECOND_value,
MILLISECOND => MILLISECOND_value);