Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69031

Problem typecasting byte array to float array

$
0
0

Can someone help me find the part of this process that I am doing wrong?

 

  • I am reading a string of 6 floats over serial.
  • I take the string and convert it into a byte array.
  • I then reverse the byte array because my microcontroller is sending the LSB first and Labview is Big-endian
  • I typecast this array to a float array
  • I reverse the array again to get the data back into the original order

I can see the bytes coming into the byte array as 'byte, 0, 0, 0' when it is a small number but when i typecast I get really large or really small floats. Can someone help me figure this out?

 

Thanks!

 

Labview 2011

  • byte_to_float_error.JPG

Viewing all articles
Browse latest Browse all 69031

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>