LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make DBL out of 8 chars?

I have a set of characters which represents binary data.
Every 8 characters meant to be 1 DBL number. How to convert 8 chars to 1 DBL?

Message Edited by jonni on 08-08-2006 08:08 AM

0 Kudos
Message 1 of 4
(2,718 Views)
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 4
(2,701 Views)
We have to be a little careful with terminology here. 8 characters = 64 bits (8 bits per character). The IEEE 754 spec defines how to store floating point numbers in binary notation. In LabVIEW you can use the "Type Cast" function. LV 7 doesn't have U64 so you have to create an array of two U32 numbers (use the "Hex Sting to Number" function) corresponding to the "high word" and "low word". Then, feed the array into a "Type Cast" function providing a DBL constant for the "type" input. LV 8 has a U64 so you should be able to create a U64 directly.

Side note: be sure to set your indicator's precision correctly else it will look like you're only getting part of the number.
Message 3 of 4
(2,701 Views)

I simply wired string of 8 characters to "Type Cast" function providing a DBL as constant for the "type" input.

Everything worked perfectly all right.

Message Edited by jonni on 08-09-2006 05:50 PM

0 Kudos
Message 4 of 4
(2,661 Views)