LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert double to byte array...

> Thanks so much. It worked perfectly. I have another section where I
> have to do the same thing, but the integer is a 48-bit TWO'S
> COMPLEMENT number now. I can't just divide by 256 anymore...but have
> to worry about negation and stuff. Can LabVIEW help w/ anything like
> this? Thanks.

You will need some test cases, but I think that treating the 48 bit
number as a signed 16 bit and an unsigned 32 bit number will be
equivalent -- assuming that you handle reassembling them according to
endianness.

Greg McKaskle
0 Kudos
Message 11 of 17
(3,745 Views)
Hi...sorry, could you do me a favor? Could you save your VI in LabVIEW 6.0 format? Sorry...I haven't upgraded yet. Thanks again.
0 Kudos
Message 12 of 17
(3,964 Views)
0 Kudos
Message 13 of 17
(3,745 Views)
You are a genius. Thank you!
0 Kudos
Message 14 of 17
(3,745 Views)
I am perhaps trying to do essentially the same thing. The latest version of LV that I have is 6.0 Could you recompile the example in 6.0 format for me so I can open it?
Thanks
Kert
0 Kudos
Message 15 of 17
(3,964 Views)
Oops,
Never mind. I just read further and see that you have already recompiled in 6.0 format. Thanks Much!
Kert
0 Kudos
Message 16 of 17
(3,964 Views)
To those interested,

Attached is an example of the conversion from a double float to a 64 bit integer based on the bitwise definition of a double float in a big endian evironment (LabView under Windows i386). This incorperates some of the suggestions made by others herin. It is typically what you would write in C or assembly.

The library contains three vis, two conversion vis, and a test vi to insure the conversions work properly.

I'm not sure what the bit pattern will be in a small endian environment so I cannot provide the equivalent example. However, if you take the time to understand the example code provided, converting to small endian should not be difficult.

Kind regards,
Eric
0 Kudos
Message 17 of 17
(3,745 Views)