Split DATE into INT values
SPLIT_DATE_INT splits a value of the data type DATE into INT values for year, month, and day.
Input
date
Output
year
month
day
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
DATE_value: DATE:=D#2011-12-24;
YEAR_value: INT:=0;
MONTH_value: INT:=0;
DAY_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 := 5 ;
NETWORK_BODY
B(B_F,SPLIT_DATE_INT!,Instance,16,0,25,5,,?DIN?CYEAR?CMONTH?CDAY);
B(B_VARIN,,DATE_value,14,1,16,3,);
B(B_VAROUT,,YEAR_value,25,1,27,3,);
B(B_VAROUT,,MONTH_value,25,2,27,4,);
B(B_VAROUT,,DAY_value,25,3,27,5,);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
SPLIT_DATE_INT(IN := DATE_value,
YEAR => YEAR_value,
MONTH => MONTH_value,
DAY => DAY_value);