08-14-2009 05:16 PM
I'm fairly new to Labview, and haven't found an example of this on these forums. Any help would be greatly appreciated!
I'm reading in a character stream from a serial device, and I wish to convert a 4-byte string (or ubyte array) into a float value. Is there a way to do this in labview?
For example, I have the array { 0x4b, 0x1c , 0x90, 0x42 } = 0x4b1c9042 = a float value of 72.055260
I can do this in c by:
char floatarray[] = {0x4b, 0x1c , 0x90, 0x42, 0x00};
memcpy( &floatvalue, &floatarray, sizeof(float) );
printf("\nMy float value is %f", floatvalue); // would give 72.055260 for floatvalue
Is there a way to accomplish this in Labview?
Solved! Go to Solution.
08-14-2009 05:29 PM - edited 08-14-2009 05:31 PM
08-14-2009 05:32 PM - edited 08-14-2009 05:33 PM
Note that if you're getting the string in that order then you will need to reverse the string first:
08-14-2009 05:37 PM