LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex to Decimal Conversion

Hello all,

 

I want to convert Hex data to Decimal data. I will get Hex data and Bit Length.  As per bit length I’m changing my data type (i.e. I8, I16, I32 or I64).

 

Please help me, my understanding is correct/not.

 

Byte Bit Data Type
1 0-7 I8 Byte
8-15 I16 Word
       
2 8-15 I16 Word
16-31 I32 Dword
4 32-63 I64 Qword

 

 

Hex Data Bit Length Data Type Decimal Value
E8 6 I8 -24
12 7 I8 18
BD 8 I16 187
B7 8 I16 183
FF 01 9 I16 511
FA FF 10 I16 -6
21 00 10 I16 33
FF FF 16 I 32 65535
FF FF FF FF 32 I64 4294967295
40 30 12 00 32 I64 1192000
44 00 00 00 00 32 I64 68
80 25 00 00 32 I64 9600

 

BR,

Munna

Munna
0 Kudos
Message 1 of 4
(3,059 Views)

Dear all,

 

Sorry for sending my post in wrong Forum.

 

Please don't mind.

 

BR,

Guru

Munna
0 Kudos
Message 2 of 4
(3,056 Views)

I asked the moderator to move this thread to the LabVIEW board.

 

 

Please be a little more specific.  You have 16-bit bytes?  That's impossible since a byte is defined by 8 bits.

 

How do you know how many bits are in the word?  Where is this data coming from?  Please provide a VI with example data in a control and an expected output in an indicator.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(3,049 Views)

Dear Crossrulz,

 

Thank you so much for your help.

 

Regarding your questions,

 

1. Yes, your right Byte is defined by 8 bits, Here 16 bits means total data in 2 Bytes.

2. I will get Bit Length, Byte Length and Byte Information (Hex data) from file.

3. I'm trying to read Binary file. Where I will get all these information. Based on this information I need to convert this Hex data  to decimal values.

 

Thanks & Regards,

Munna

Munna
0 Kudos
Message 4 of 4
(3,041 Views)