LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Float 32 (Single) to EEPROM via I2C

Solved!
Go to solution

I'm trying to store a 32-bit float (single) onto 4 bytes of EEPROM memory via the I2C bus.  I'm using a parallel cable to bit-bang 8 bits per ack onto the EEPROM chips.

 

The only way I can think of doing this is to split the Single into one I8 and three U8's.  Is there even a need for this or should I just typecast to U32 and use arrays.  Admittedly, I'm horrible with arrays and I can't really wrap my head around how to do this.  Any help will be appreciated, and if I'm not very clear, I can clarify.  Thanks for any assistance.

 

e.g.
3D23D70A -> 3D

                    23

                    D7

                    0A

0 Kudos
Message 1 of 4
(3,112 Views)
bump.JPG
0 Kudos
Message 2 of 4
(3,096 Views)
Solution
Accepted by Bawb

Found my solution, here it is for posterity; if anyone is ever interested and/or can share improvements, please do.

 

Single Property Node Value typecasted to U32, then two tiers of the "Split Number" function to get the four U8 bytes, then fed them into my custom I2C 4-Byte write .vi. 

lv85.png

0 Kudos
Message 3 of 4
(3,077 Views)

Easier way to get 4 bytes of U8.

 

Typecast Float SGL - Array U8_BD.png

0 Kudos
Message 4 of 4
(3,064 Views)