DT_TO_UDINT

DATE_AND_TIME into unsigned DOUBLE INTEGER

DT_TO_UDINT converts a value of the data type DATE_AND_TIME into a value of the data type Unsigned DOUBLE INTEGER according to its internal format, which is seconds elapsed since "2001-01-01-00:00:00".

Parameters

Input

Unnamed input (DT)

input data type

Output

Unnamed output (UDINT)

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
		UDINT_value: UDINT:=0;
		DT_value: DATE_AND_TIME:=DT#2016-07-04-16:30:30;
	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_UDINT!,Instance,16,1,24,3,,?D?C);
B(B_VARIN,,DT_value,14,1,16,3,);
B(B_VAROUT,,UDINT_value,24,1,26,3,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

UDINT_value := DT_TO_UDINT(DT_value);

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