IS_VALID_DATE_INT

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.

Parameters

Input

YEAR (INT)

1st input: year

MONTH (INT)

2nd input: month

DAY (INT)

3rd input: day

Output

VAR_OUT (BOOL)

set to TRUE if the resulting date value is valid

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
		YEAR_value: INT:=2011;
		MONTH_value: INT:=12;
		DAY_value: INT:=24;
		VALID: BOOL:=FALSE;
	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 := 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

ST body

VALID := IS_VALID_DATE_INT(YEAR := YEAR_value, 
               MONTH := MONTH_value, 
               DAY := DAY_value);

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