LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Modbus integer to float

Solved!
Go to solution

I'm working on a VI that controls an electric motor through an Emotron AC drive, using the modbus library. I have no problem getting the motor to run and read its speed, however when trying to read the torque i get a problem.

 

It seems the Emotron drive is using its own format for floating point numbers, see attached page from the manual. So when reading the torque in Labview i get a number like 65431 something, how can I convert this to floating point using the method descriped in the manual?

Download All
0 Kudos
Message 1 of 4
(4,148 Views)

Hi Sur,

 

like this:

check.png

(I hope I did the bit counting correctly…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(4,145 Views)
Solution
Accepted by topic author SurKaktus

Too late to edit my previous post…

 

Forgot to take into account the sign expansion of the exponent:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(4,131 Views)

Thank you very much! Worked perfectly.

0 Kudos
Message 4 of 4
(4,110 Views)