TOD_TO_STRING

TIME_OF_DAY into STRING

TOD_TO_STRING converts a value of the data type TIME_OF_DAY into a value of the data type STRING[8].

The range for the input time of day is from TOD#00:00:00 to TOD#23:59:59.

Parameters

Input

Unnamed input (TIME_OF_DAY)
Input data type

Output

Unnamed output (STRING)
Conversion resultSTRING[8]

Remarks

All character spaces in the result string will be filled.

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#18:29:59;
		STRING_value: STRING[19]:='';
	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 := 5 ;
        NETWORK_BODY
B(B_VARIN,,TOD_value,15,1,17,3,);
B(B_VAROUT,,STRING_value,26,1,28,3,);
B(B_F,TOD_TO_STRING!,Instance,17,1,26,3,,?D?C);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

STRING_value := TOD_TO_STRING(TOD_value);

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