Showing results for 
Search instead for 
Did you mean: 

the hexa decimal to decimal is not working propoerly

Go to solution

I'am attaching one VI where , read string after the VISA serial which is put to the hexadecimal conversion  . This should give the converted decimal number at the number label. But it's not providing that. So can you send me  a solution for this. 

0 Kudos
Message 1 of 9

Well, how does the received string look like? (the display is set to \codes, so maybe it is not formatted as you seem to think)


Can you run your VI until the "read string" indicator contains data, then make the current value the default, save the VI under a new name, and attach it again?


We cannot tell what you are getting. Your current code assumes a formatted hexadecimal string, exclusively containing the characters 0..F.

Since you are sending a U8 numeric typecast to a string, maybe you get a binary string that needs to be typecast back to a numeric fo the correct type instead.

0 Kudos
Message 2 of 9

I'am attaching the file with default values

0 Kudos
Message 3 of 9

You are reading a single byte and it is NOT a readable character between 0 and F, so trying to scan it as a hexadecimally formatted number makes no sense. Assuming it is a binary string of U8 data type, typecasting will return a 200. Is that what you expect?

(it could also be I8, in which case the value would be -56)



0 Kudos
Message 4 of 9
Accepted by topic author perumpadapu

thank you for your help

0 Kudos
Message 5 of 9

(You typically would mark the most helpful answer as solution, and not you own final comment.)

0 Kudos
Message 6 of 9

your suggestion is good but since that VI will not work in labview 7 can you please sent the methodology of conversion using the VI's and what changes you had made for it. ANd if possibel please sent the VI in labview 7 form

0 Kudos
Message 7 of 9

Sorry, LabVIEW 7 is ancient. You are already typecasting a number to a string elsewhere, so you simply need to do the reverse: typecast the string to a U8 constant.


Create a U8 diagram constant bu placing a numeric diagram constant and setting the representation to U8 (right-click...representation). Wire that as type as follows: (read string is set to hex display, but that is just cosmetic)



0 Kudos
Message 8 of 9
0 Kudos
Message 9 of 9