LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 Write without ASCII code

I am writing a VI to take a number 0-100, input by the user, and write the hex equivalent to the RS232 port.  My problem is that the VISA write block automatically converts the number to ASCII.  Is there a solution less cumbersome than having the user enter the number as a hex value in \ code format?
 
Thanks for your help,
-John
0 Kudos
Message 1 of 5
(3,251 Views)
There's a primitive called Byte Array to String which accepts a 1D array of U8 and converts it to the corresponding ASCII characters.

___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(3,249 Views)

The VISA Write doesn't do any conversion at all. It just sends whatever you pass to it. If you convert your number to ASCII, then it will send ASCII. You can use the type cast function. Another option is the Byte Array to String.



Message Edited by Dennis Knutson on 03-13-2008 02:27 PM
0 Kudos
Message 3 of 5
(3,243 Views)
The problem is that I don't want the data to be ASCII formatted when it leaves the serial port.  My solution was to enter a code ('\15' would output an ASCII 'F').  However, this made my user interface somewhat unfriendly.
0 Kudos
Message 4 of 5
(3,240 Views)
Thank you Dennis, that's exactly what I needed.
0 Kudos
Message 5 of 5
(3,233 Views)