CONCAT_TOD_INT

Concatenate INT values to form the time of day

CONCAT_TOD_INT concatenates the INT values for hour, minute, second, and millisecond. The result is stored in the output variable of the data type TIME_OF_DAY. The Boolean output ERROR is set if the input values are invalid date or time values.

Parameters

Input

HOUR (INT)

1st input: hour

MINUTE (INT)

2nd input: minute

SECOND (INT)

3rd input: second

MILLISECOND (INT)

4th input: millisecond

Output

VAR_OUT (TIME_OF_DAY)

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
		TOD_value: TIME_OF_DAY:=TOD#00:00:00;
		HOUR_value: INT:=18;
		MINUTE_value: INT:=29;
		SECOND_value: INT:=59;
		MILLISECOND_value: INT:=0;
		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,,TOD_value,27,1,29,3,);
B(B_VAROUT,,ERROR,27,2,29,4,);
B(B_VARIN,,HOUR_value,15,1,17,3,);
B(B_VARIN,,MINUTE_value,15,2,17,4,);
B(B_VARIN,,SECOND_value,15,3,17,5,);
B(B_VARIN,,MILLISECOND_value,15,4,17,6,);
B(B_F,CONCAT_TOD_INT!,Instance,17,0,27,6,,?DHOUR?DMINUTE?DSECOND?DMILLISECOND?C?CERROR);
L(1,0,1,9);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

TOD_value := CONCAT_TOD_INT(HOUR := HOUR_value, 
                MINUTE := MINUTE_value, 
                SECOND := SECOND_value, 
                MILLISECOND := MILLISECOND_value, 
                ERROR => ERROR);

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