REAL_TO_DWORD

REAL into DOUBLE WORD

REAL_TO_DWORD moves bit set information of a REAL variable to a DWORD variable. The same functionality can be obtained using DWORD_OVERLAPPING_DUT.

Parameters

Input

Unnamed input (REAL)

Input data type

Output

Unnamed output (DWORD)

Conversion result

Remarks

If the required data type is supported, we recommend using the overloaded instruction TO_DWORD

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
		REAL_value: REAL:=234.567;
		DWORD_value: DWORD:=16#00000000;
	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 := 2 ;
        NETWORK_BODY
B(B_F,REAL_TO_DWORD!,Instance,8,0,18,2,,?D?C);
B(B_VARIN,,REAL_value,6,0,8,2,);
B(B_VAROUT,,DWORD_value,18,0,20,2,);
L(1,0,1,2);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

DWORD_value := REAL_TO_DWORD(REAL_value);

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