CONCAT_TIME_INT

Concatenate INT values to form a time

CONCAT_TIME_INT concatenates the INTEGER values for days, hours, minutes, seconds, and milliseconds.The result is stored in the output variable of the data type TIME.The Boolean output ERROR is set if the input values are invalid date or time values.

Parameters

Input

DAYS (INT)

1st input: days

HOURS (INT)

2nd input: hours

MINUTES (INT)

3rd input: minutes

SECONDS (INT)

4th input: seconds

MILLISECONDS (INT)

5th input: milliseconds

Output

VAR_OUT (TIME)

Result

ERROR (BOOL)

The Boolean output ERROR is set if the input values are invalid date or time values.

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
		TIME_value: TIME:=T#0s;
		DAYS_value: INT:=234;
		HOURS_value: INT:=15;
		MINUTES_value: INT:=58;
		SECONDS_value: INT:=57;
		MILLISECONDS_value: INT:=890;
		ERROR: 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 := 9 ;
        NETWORK_BODY
B(B_VAROUT,,TIME_value,27,1,29,3,);
B(B_VAROUT,,ERROR,27,2,29,4,);
B(B_VARIN,,DAYS_value,15,1,17,3,);
B(B_VARIN,,HOURS_value,15,2,17,4,);
B(B_VARIN,,MINUTES_value,15,3,17,5,);
B(B_VARIN,,SECONDS_value,15,4,17,6,);
B(B_VARIN,,MILLISECONDS_value,15,5,17,7,);
B(B_F,CONCAT_TIME_INT!,Instance,17,0,27,7,,?DDAYS?DHOURS?DMINUTES?DSECONDS?DMILLISECONDS?C?CERROR);
L(1,0,1,9);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

TIME_value := CONCAT_TIME_INT(DAYS := DAYS_value, 
                  HOURS := HOURS_value, 
                  MINUTES := MINUTES_value, 
                  SECONDS := SECONDS_value, 
                  MILLISECONDS := MILLISECONDS_value, 
                  ERROR => ERROR);

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