02-20-2014 05:13 AM
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
02-20-2014 05:15 AM
Dear all,
Sorry for sending my post in wrong Forum.
Please don't mind.
BR,
Guru
02-20-2014 06:08 AM
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.
02-20-2014 07:31 AM
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