LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting floating point or hexadecimal number to ascii value

Hi All
 
I am using LV8.0 FDS
 
i find a difficulty converting the floating point or hexadecimal values in the rangeof 0 to 255 to an ascii value using the typt cast vi.
 
If my value is between 0 to 127 it is showing the appropriate ascii value. but for value >127 it is converting the value to ascii value but different one.(Eg. for an floating value of 241 it shows the ascii value of 164).
 
How to solve this? Is there anything specifc to mention in the type input in the type cast vi other than char
 
Plz get me the solution
 
thanks
kiran
0 Kudos
Message 1 of 2
(3,214 Views)

It is not clear what you want.

If you typecast a DBL (floating point) for example, you'll get 8 bytes, but it seems you only want a single byte. (0..255)

If you say "hexadecimal values", you are probably dealing with integers set to hex display. Are you?

Are you trying to cast to a string (set to hex display)? Your wording "to ASCII" is misleading, since ASCII does not describe the full 8 bit set you seem to want. (http://en.wikipedia.org/wiki/ASCII). Or do you want to FORMAT your number as a hex formatted ascii string (2 bytes/8bits, exclusively containing the characters 0..F).

Most likely, converting your number to U8, then typecast to a string would be one possible solution. (if I understand your problem correctly).

Please attach your VI so we can see what kind of data you have and what output you want. Thanks! 🙂

Message Edited by altenbach on 09-24-2007 10:25 PM

0 Kudos
Message 2 of 2
(3,213 Views)