LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert a number into an ascii code

Hi,:
I just start to use Labview. i plan to use the labview to talk to Rs232. here is my question:
i have unsigned 8 bits number, i plan to convert the number into a letter so that i can send it to RS232. for example, i have unsinged number 85, i want to convert it into "U" since "U" is the corresponding letter of ascii code 85,

can you please tell me how i should do it,

thank you,

0 Kudos
Message 1 of 9
(2,817 Views)

Make sure the unsigned number is 8 bit (U8), then use typecast.

0 Kudos
Message 2 of 9
(2,815 Views)

Hi, Christian:

Thank you for your message!

 

i used the type cast, but it seems VISA write can not recognize it, what is the problem?

 

 

0 Kudos
Message 3 of 9
(2,779 Views)

Untitled.png

 

Sorry, see the image

0 Kudos
Message 4 of 9
(2,776 Views)

I don't see any visa write in your image.

0 Kudos
Message 5 of 9
(2,771 Views)

see thisUntitled.png

0 Kudos
Message 6 of 9
(2,757 Views)

sorry, it seems i can get the correct character of the corresponding ascii code. however, it seems input is wrong. see the attached error message

0 Kudos
Message 7 of 9
(2,749 Views)

The error is in "cofigure serial port", way before the string operation. Make sure all inputs there are valid. How do you define the visa resource?

0 Kudos
Message 8 of 9
(2,728 Views)

Thank you for your message.

it seems i did not define the  com port correctly

0 Kudos
Message 9 of 9
(2,716 Views)