SPLIT_TOD_INT

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.

Parameters

Input

IN (TIME_OF_DAY)

time of day

Output

HOUR (INT)

hour

MINUTE (INT)

minute

SECOND (INT)

second

MILLISECOND (INT)

millisecond

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;
		HOUR_value: INT:=0;
		MINUTE_value: INT:=0;
		SECOND_value: INT:=0;
		MILLISECOND_value: INT:=0;
	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 := 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

ST body

SPLIT_TOD_INT(IN := TOD_value, 
          HOUR => HOUR_value, 
          MINUTE => MINUTE_value, 
          SECOND => SECOND_value, 
          MILLISECOND => MILLISECOND_value);

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