LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex to decimal



@j_es wrote:
Process 2 doesnt work for all hex values a-f and 4 doesnt do it. Didnt check 3.

So go with #1! 😉 The reason 2 and 3 do not work exactly the same for higher numbers is the fact that the intermediaray decimally formatted string has more than four digits. Remember that you never provided full specifications and I could not even assume that your overly complex algorithm was correct for all inputs so I made some guesses.

Still somehow this entire algorithm seems quite silly. (Yes, it does! :o). Who in his right mind would design it this way? Are you sure that yours (and #1) really work according to the specifications? What kind of device generates the input string? Is the programming manual and format specifications available for download somewhere?

Message 11 of 16
(2,355 Views)

Hello " ",

I used the vi you developed and observed that all the methods are showing the same decimal value as 1800 for hexadecimal value 0007 0008 but the actual decimal value should be 458760.

Can someone explain what is the problem with these methods in the vi.

Thanks.

0 Kudos
Message 12 of 16
(1,394 Views)

The problem is that you continue to give vague, undefined requirements.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 13 of 16
(1,381 Views)

How to correct the above vi working and can I get details of how to extract and convert 1)each hexa value to decimal and to 4bit binary and 2)each hexa value to decimal and to 8bit binary.

0 Kudos
Message 14 of 16
(1,378 Views)

This is a 6 year old thread with a relatively special problem description. What makes you think it applies to your problem?

 

Be much more clear what you have (string, how many bytes, formatted, binary, display style) and what you want.  (Datatype, etc).

Use well defined words ("hexa" has no meaning).

 

Easiest would be if you could attach a VI with appropriate default values.

0 Kudos
Message 15 of 16
(1,360 Views)

@stefan57 wrote:

Hello "@altenbach ",

I used the vi you developed and observed that all the methods are showing the same decimal value as 1800 for hexadecimal value 0007 0008 but the actual decimal value should be 458760.

Can someone explain what is the problem with these methods in the vi.


You don't need "these methods", because your problem is trivial!

 

A simple unflatten or typecast to I32 (or U32) will do exactly what you need.

 

 

(sorry, was posting by phone earler and could not test)

 

 

 

Download All
0 Kudos
Message 16 of 16
(1,336 Views)