DATE_TO_UDINT

DATE into unsigned DOUBLE INTEGER

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

Parameters

Input

Unnamed input (DATE)

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;
		DATE_value: DATE:=D#2008-05-12;
	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,DATE_TO_UDINT!,Instance,16,2,25,4,,?D?C);
B(B_VARIN,,DATE_value,14,2,16,4,);
B(B_VAROUT,,UDINT_value,25,2,27,4,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

UDINT_value := DATE_TO_UDINT(DATE_value);

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