From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Float to HEX and back to float(bytewise)

 

  1. Float val=12.961126;

4BYTES HAS BEEN ALLOCATED

12.961126

 

 

2.

1 BYTE

1 BYTE

1 BYTE

1 BYTE

 

3.

THEN CONVERT TO HEX FORMAT (BYTEWISE)

NOTE:rough value taken for explanation

NOTE:WHOLE 4 BYTES ARE NOT CONVERTED TO HEX.HERE BYTE BY BYTE IS CONVERTED TO HEX

4B

56

A4

FF

 

4.

 

                                                NOW GETTING BACK THE ORIGINAL VALUE.

 

 

 

 

This im facing while getting float value from visa read.any HELP

 

-------------------------------------------------------------
kudos welcome
0 Kudos
Message 1 of 30
(9,697 Views)

One way to convert is to just use type cast. It works also in the other direction (Byte array to Float). But it seems I don't get your numbers.

 

21830iC2075E029EB1235B

 

EDIT: If you need it in string format use the corresponding conversion function:

 

21832i87F3524382458409

 

Hope this helps.

 

Message 2 of 30
(9,683 Views)

Hi dan,

      I knew 1st ill be receiving this post.

      im looking for seperate byte by byte of float to hex conversion and viceversa not the whole float conversion.

 no problem with that.

I want the same thing to be done in byte by byte.

 

-------------------------------------------------------------
kudos welcome
0 Kudos
Message 3 of 30
(9,669 Views)

Hi,

I Cant able to open your attachment. please give me a snapshot of your attachment or a doc which can open with word 2003.

 

Thanks

Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 4 of 30
(9,658 Views)

Did you look at the 2nd image in my post?

Float-to-StringArray.png

This returns an array, so you can operate byte-wise.

 

Message 5 of 30
(9,648 Views)

Hello,

 

if I understand your problem, you need to use the "String to Byte Array" node  to convert the raw string to its byte representations to send them via VISA.

 

@ Baji: Problems with docx are to be solved here: http://www.microsoft.com/downloads/details.aspx?FamilyId=941b3470-3ae9-4aee-8f43-c6bb74cd1466&displa...

 

greets, Dave

Greets, Dave
0 Kudos
Message 6 of 30
(9,646 Views)

hey Dan,

       send me the vi of what you are getting

-------------------------------------------------------------
kudos welcome
0 Kudos
Message 7 of 30
(9,636 Views)

Here you are.

 

 

0 Kudos
Message 8 of 30
(9,633 Views)

Hi baji,

vi attached of what we were discussing

-------------------------------------------------------------
kudos welcome
0 Kudos
Message 9 of 30
(9,629 Views)

Hey dan,

       only number 41 matches others wont.

see the vi i have attached 

-------------------------------------------------------------
kudos welcome
0 Kudos
Message 10 of 30
(9,619 Views)