LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert hexadecimal output to decimal (number)

My bad it does not work. The FF part in the exponent gets converted to 255 of course if I just use Hexadecimal to Number block.

So I have to think of something else.
0 Kudos
Message 21 of 29
(1,712 Views)
Your Idea is incorrect. If the exponent is "twos-complement" (sorry I missed that) you must interpret it as I8.
(See e.g. http://nssdc.gsfc.nasa.gov/nssdc/formats/IntegerNumbers.htm for a definition). The exponent is NOT in BCD.

"FF" MUST translate to "-1", not 255. I added a small modification that deals with this. Basically, we read it as I8(!), giving the correct answer. (In principle, we could type cast the exponent directly to I8 from the third byte of the original triplet, but I think the current solution is fine and easier to read).
0 Kudos
Message 22 of 29
(1,712 Views)
You can see that in meanwhile I realized the mistake and posted a new comment.
This solves the problem.
I just need to find the effective way to join the status and numbers arrays now beacause I will be displaying this data using 8 indicators for each gauge.

Any suggestions???
(this is embarassing I will stop right after this)

thanks
Pedja
0 Kudos
Message 23 of 29
(1,712 Views)
If this is just for display, I'd suggest to display everything as string directly. (You can even get rid of the DBL output entirely, unless you need to do some math with the results).
Generally, I think too many indicators clutter the UI and complicate the diagram, so I'd suggest to use a single text box as shown in the attached example (Which also contains the twos-compelement fix).

For the text output I use a fixed-width font (Courier New) so the numbers are vertically aligned.
0 Kudos
Message 24 of 29
(1,734 Views)
I have just replied higher up with a suggestion.
0 Kudos
Message 25 of 29
(1,712 Views)
The string would be a neat way to do it but I will use this subVI as part of the big system VI which will basically have the picture of the chambers and at certain points it will have gauges attached and thats where the 8 indicators will come into a play. I need them so that I can place them around the drawing as needed.

However I will talk to mu supervisor about an option of just labelling the gauges around and using the single window (string) with all the readings.

Thanks
0 Kudos
Message 26 of 29
(1,712 Views)
You can also just create an array of single-line strings for each output. Correctly formatted, it will not look any different to a numeric indicator, but you can also display error conditions directly.
0 Kudos
Message 27 of 29
(1,714 Views)

Saludos a todos, tengo una aplicacion en LaBView wn la cual necesito convertir un String Hexadecimal que introduce el usuario a su equivalente en decimal

El numero de caracteres en Hexa es variable y mayor de 16 (Ej, FCFF00CCBA03FDCC), al usar STRING HEXADECIMAL TO DECIMAL, este solo me permite convertir 8 caracteres.

 

Tomando en cuenta que el numero de caracteres es variable y supera los 16, no tengo idea de como solucionar este problema de una forma sencilla, por lo cual agradezco cualquier ayuda que me puedan dar. Doy gracias de antemano por la colaboracion prestada a este asunto.

0 Kudos
Message 28 of 29
(932 Views)

Marwuin,

 

Please do not hijack an old thread.  Start a new thread.  In the LabVIEW board, post in English.  Otherwise you can post in spanish here.

Message Edited by Ravens Fan on 02-23-2010 10:44 PM
0 Kudos
Message 29 of 29
(908 Views)