DT_TO_TOD

DATE_AND_TIME into TIME_OF_DAY

DT_TO_TOD converts a value of the data type DATE_AND_TIME into a value of the data type TIME_OF_DAY.

Parameters

Input

Unnamed input (DATE_AND_TIME)
Input data type

Output

Unnamed output (TIME_OF_DAY)
Conversion result

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
		DT_value: DATE_AND_TIME:=DT#2011-12-24-18:29:59;
		TOD_value: TOD:=TOD#00:00:00;
	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 := 5 ;
        NETWORK_BODY
B(B_F,DT_TO_TOD!,Instance,15,2,22,4,,?D?C);
B(B_VARIN,,DT_value,13,2,15,4,);
B(B_VAROUT,,TOD_value,22,2,24,4,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

TOD_value := DT_TO_TOD(DT_value);

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