Check whether DATE is valid
IS_VALID_DATE_INT checks whether the combination of the INT values for the year, month, and day is a valid DATE value. The Boolean output flag is set if the date is valid.
Input
1st input: year
2nd input: month
3rd input: day
Output
set to TRUE if the resulting date value is valid
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
YEAR_value: INT:=2011;
MONTH_value: INT:=12;
DAY_value: INT:=24;
VALID: BOOL:=FALSE;
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 7 ;
NETWORK_BODY
B(B_VARIN,,YEAR_value,8,1,10,3,);
B(B_VARIN,,MONTH_value,8,2,10,4,);
B(B_VARIN,,DAY_value,8,3,10,5,);
B(B_F,IS_VALID_DATE_INT!,Instanz,10,0,20,5,,?DYEAR?DMONTH?DDAY?C);
B(B_VAROUT,,VALID,20,1,22,3,);
L(1,0,1,7);
END_NETWORK_BODY
END_NET_WORK
END_BODY
VALID := IS_VALID_DATE_INT(YEAR := YEAR_value,
MONTH := MONTH_value,
DAY := DAY_value);