TIME_TO_REAL

TIME into REAL

TIME_TO_REAL converts a value of the data type TIME into a value of the data type REAL. 10ms of the data type TIME correspond to 1.0 REAL unit, e.g. when TIME = 10ms, REAL = 1.0; when TIME = 1s, REAL = 100.0. The resolution amounts to 10ms.

Parameters

Input

Unnamed input (TIME)

input data type

Output

Unnamed output (REAL)

Conversion result

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
		input_time: TIME:=T#1h1m1s;
		result_time: REAL:=0.0;
	END_VAR

This example uses variables. You can also use a constant for the input variable.

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_F,TIME_TO_REAL!,Instance,8,2,17,4,,?D?C);
B(B_VARIN,,input_time,6,2,8,4,);
B(B_VAROUT,,result_time,17,2,19,4,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

result_real:=TIME_TO_REAL(input_time);

IL body

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