Posted 18 Apr 2019 I am having problem converting a DWORD variable to a floating point decimal. I've tried using the DWORD_TO_REAL function. Having the hex value "41E9B814" as an input I was expecting to get "29.2148819" as an output. However, I'm getting "1.110194.." as the output. Any ideas? Share this post Link to post Share on other sites
Posted 18 Apr 2019 The DWORD_TO_REAL treats the DWORD as if it is unsigned integer format. Your value is already in real format, but it is in a variable that is treating it as a DWORD. The DWORD_TO_REAL instruction then converts the UDINT value of your DWORD to a real number. I am guessing that the Force Variable is a union and that this is coming in via EtherNet/IP or something.... You need to use the CopyDwordToReal instruction shown below: Share this post Link to post Share on other sites