Beijer Electronics (formerly QSI Corporation)
http://www.qsiforums.com/

Floating point to byte stream
http://www.qsiforums.com/viewtopic.php?f=6&t=4461
Page 1 of 1

Author:  kkwon [ Tue May 29, 2012 1:59 pm ]
Post subject:  Floating point to byte stream

Hi,
What is the easiest way to convert a 32-bit floating point variable to a four byte equivalent to be transmitted in a byte stream?

Author:  Ron L. [ Tue May 29, 2012 8:58 pm ]
Post subject:  Re: Floating point to byte stream

Using the function "GetBytes".

The code might look something like this.
Code:
    dim f as float

    transmit(COM1, GetBytes(f, true), false)

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/