LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal number to ASCII string

Hi everybody! Smiley Happy

how to convert a decimal number between 0 and 255 in ASCII code ?!

I found the program attached in this forum and it works correctly...
But sometimes if I reply it in my program, it convert only until number 127  Smiley Sad
(See the second file attached to verify!!!)

By the way, is it possible to send with the function "Write Serial" a specified byte and NOT an ASCII code ?!?! Smiley Mad

Thank you everybody  Smiley Wink





Message Edited by Jacopo on 07-03-2008 02:13 AM
Download All
0 Kudos
Message 1 of 3
(8,933 Views)

Hi Jacopo,

you can also use the "byte array to string" function.

Mike

0 Kudos
Message 2 of 3
(8,922 Views)


Jacopo wrote:
But sometimes if I reply it in my program, it convert only until number 127  Smiley Sad

You need to use U8. If you use I8 you can only go up to 127 because the first bit is for the sign. Simply change the representation.


Jacopo wrote:
By the way, is it possible to send with the function "Write Serial" a specified byte and NOT an ASCII code ?!?! Smiley Mad

Write serial accepts a string. If the string is lenght=1 it is a byte. What else do you want? Just specify what byte you want and you're all set. 🙂
If you wan to enter it manually on a string control, set the control to hex display.

0 Kudos
Message 3 of 3
(8,907 Views)