LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ascii to deimal conversion

hey i have a device sending 2 bytes of data from RS232 port,i have set the display at hex display ,when i apply that to hex string to number function its not converted, may be due to the result not in normal mode????.can any one tell me how can i convertthe ascii data to decimal data??
0 Kudos
Message 1 of 6
(3,308 Views)
use typecast with the correct type (e.g. U16 or I16). The display setting is just cosmetic and has no influence on the underlying data.
0 Kudos
Message 2 of 6
(3,301 Views)
Here's an example:
 

Message Edited by altenbach on 08-20-2007 11:18 AM

0 Kudos
Message 3 of 6
(3,295 Views)
hey altenbach
thanks for the help
does this convert signed numbers whose ascii's are being generated into decimal??
i mean how are the signed numbers manipulated?
thanks
0 Kudos
Message 4 of 6
(3,293 Views)
If you want signed numbers, make the diagram constant into I16 representation (right-click).
 
Numerics are internally always binary.  "decimal" for numeric indicators is just a cosmetic property. If you have a formatted string, you need to know the format it is supposed to be. If you have a binary string as in your example, you just need to know the correct datatype and you need to ensure that the byte count matches.
0 Kudos
Message 5 of 6
(3,290 Views)
ok will try it.
thanks for the help
will ask you if i get any problems 🙂
regards
sdi


0 Kudos
Message 6 of 6
(3,284 Views)