0% found this document useful (0 votes)
9 views7 pages

Solved - Convert Hex String To Number - NI Community

The document is a discussion forum thread focused on converting a hexadecimal string to a number in LabVIEW. Participants provide various suggestions and solutions to the original poster's query, with discussions about different types of hex strings and their conversions. The thread includes multiple replies, with users sharing their experiences and asking for clarifications on the conversion process.

Uploaded by

fatyra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views7 pages

Solved - Convert Hex String To Number - NI Community

The document is a discussion forum thread focused on converting a hexadecimal string to a number in LabVIEW. Participants provide various suggestions and solutions to the original poster's query, with discussions about different types of hex strings and their conversions. The thread includes multiple replies, with users sharing their experiences and asking for clarifications on the conversion process.

Uploaded by

fatyra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

HOME / COMMUNITY / DISCUSSION FORUMS / MOST ACTIVE SOFTWARE BOARDS / LABVIEW / TOPIC

LABVIEW
Register | Login | Help

BOARD Search the community SEARCH

Topic Options  All Forum Topics

 Previous Topic Next Topic 

 Previous 1 2 Next 

 Solved! Go to solution 

Convert hex string to number 


alex.
Options 
Active Participant

‎03-24-2011 09:53 AM

As the attached vi, I am tring to convert string(hex) into number(U8), but seems not work.

Any suggestion, thanks.

 Untitled 2.vi 6‫‏‬KB

0 KUDOS (18,198 Views)


Message 1 of 14 REPLY

Re: Convert hex string to number 


ABCPrograms
Options 
Active Participant

‎03-24-2011 09:56 AM
Alex,

isn't this what you're looking for?

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's
LabVIEW 5.1 - LabVIEW 2012

3 KUDOS (18,195 Views)


Message 2 of 14 REPLY

 Solution Accepted by topic author alex.

 Re: Convert hex string to number 


ABCPrograms
Options 
Active Participant

‎03-24-2011 10:01 AM

Now you have 2 solutions :

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's
LabVIEW 5.1 - LabVIEW 2012

6 KUDOS (18,191 Views)



Message 3 of 14 REPLY

Re: Convert hex string to number 


Omar_II
Options 
Active Participant

‎03-24-2011 12:16 PM

What does your "hex string" look like? Is it human readable or it the raw bytes?
Raw bytes, then do as ABCPrograms

If you have a two byte string that represent a human readable hex number 0-255 (00 to FF)
like "1A"?
Then

Omar

2 KUDOS (18,174 Views)


Message 4 of 14 REPLY

Re: Convert hex string to number


altenbach
Options 
Knight Of NI
‎03-24-2011 12:38 PM - edited ‎03-24-2011 12:40 PM

@alex. wrote:
As the attached vi, I am tring to convert string(hex) into number(U8), but seems not work.

Any suggestion, thanks.

The question is not clear, because "hex" is very ambiguous. Please put a typical string
inside the string control and make it the default, resave, and attach once more. Then tell us
what result you expect.

How many bytes are in the string?


If it is one byte of a binary string, typecast it to U8. (It would be silly to go to a byte
array)
If it is two bytes of a hexadecimal formatted string (exclusively containing characters
0..F), scan it using %02x format.
If it is more than two bytes, you need to provide us with more information.

LabVIEW Champion.
1 KUDO (18,168 Views)

Message 5 of 14 REPLY

Re: Convert hex string to number 


[email protected].
Options 
Member
‎08-28-2014 01:41 AM

Hi All
I am trying to converter 4 bit hex string to number. I know the right results. But I do not
know how converte. Please see the attached vi
Please help me.
Thanks

 converter.vi 14‫‏‬KB

0 KUDOS (17,146 Views)


Message 6 of 14 REPLY

Re: Convert hex string to number 


GerdW
Options 
Knight Of NI
‎08-28-2014 01:51 AM

duplicate post, continue here…

Hong: What's the point of creating 3 identical posts in 3 different threads?

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019

0 KUDOS (17,140 Views)


Message 7 of 14 REPLY

Re: Convert hex string to number


dadest100
Options 
Member
‎01-09-2019 09:39 PM

Hi Alex,

But how to convert the unsigned byte array into a decimal number? I think that was the
question.

Cheers

0 KUDOS (10,851 Views)


Message 8 of 14 REPLY

Re: Convert hex string to number


GerdW
Options 
Knight Of NI

‎01-10-2019 01:04 AM

Hi dadest,

how to convert the unsigned byte array into a decimal number? I think that was the
question.
Simple answer: Just display that U8 array in an array indicator. Set the display mode to
decimal.

More complex details:


How do you want to display your U8 array?
Do you need any special conversion?
Can you provide an example with some input data and expected result?

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019


0 KUDOS (10,839 Views)

Message 9 of 14 REPLY

Re: Convert hex string to number


dadest100
Options 
Member
‎01-14-2019 06:17 PM

Hi GerdW,

Thanks for the reply. Yes, I can just display as decimal but the thing is that I want to be able
to use that data for calculations.

For example, the maximum output of my circuit is 1.3V that corresponds to 0514 (HEX)
which I am reading using Bluetooth LE.
So if I read 025C (HEX), that corresponds to 604dec and that turns out to be 0.604mVolts. I
want to be able to continuously read this voltage and display it as a waveform.

Cheers.

0 KUDOS (10,805 Views)


Message 10 of 14 REPLY

 Previous 1 2 Next 

 All Forum Topics


 Previous Topic Next Topic 

Solutions
Academic & Research / Aerospace, Defense, & Government / Electronics / Energy / Industrial Machinery /
Life Sciences / Semiconductor / Transportation

Orders
NI Distribution Partners / Order Status and History / Retrieve a Quote / Terms of Service / Order by Part
Number or Request a Quote

Company
NI is now part of Emerson / About / Emerson Careers / Newsroom / Supply Chain & Quality / Events

Support
Downloads / Product Documentation / Discussion Forums / Activate a Product / Submit a Service Request
/ Site Feedback

© 2024 NATIONAL INSTRUMENTS CORP. ALL RIGHTS RESERVED.

+91 80 4119 0000

LEGAL | IMPRINT | PRIVACY | Manage cookies India (English)

You might also like