Sign in to follow this  
Followers 0
nikitost

Dword to Float on FX3GE

2 posts in this topic

Hello!

I have a float number (HEX: 3CA01D0F) in Big Endian. It's 0.0195451062. I get it from the sensor and store it in a double word variable.

Could you help me? How can I convert DWord to Float?

If i use DFLT instruction, It treats DWord as an integer (1017126159) and just gives me 1.017126 e+009

Thanks in advance.

Share this post


Link to post
Share on other sites

Actually I need to read this from register D. So I found function DEMOV(TRUE, D0, MyFloatVar);

It transfer bytes from D0-D1 to my variable in correct format.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0