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.
Input
Input data type
Output
Conversion result
If the required data type is supported, we recommend using the overloaded instruction TO_DWORD
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
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
DWORD_value := REAL_TO_DWORD(REAL_value);