From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port cable???

Hello,

It is easy to send an arbitrary Every ascii character is represented by 8 bits (1 byte). The VISA API in LabVIEW allows you to send string data, which is really just an array of bytes. Thus, if you would like to send a specific 8-bit piece of data via serial, all you have to do is type cast that integer data (which would be an integer with U8 representation in LabVIEW) to type string. Then the VISA API will accept it, and the character (whatever it is for the number you have just type casted) will be transmitted by the serial port. When received, it will be the serial frame with start, data, parity, and stop bits as you defined on the sending side, with the data part of the frame as the 8 bits you wished to send.

Note: some ascii characters are not printable, therefore, if you were to look at the string representation of some of the 8-bit values you type cast, they may look like little boxes in LabVIEW. This does NOT mean that you are sending out the same byte everytime you see that little box; the data part of your serial frame will contain the data you type casted. If you don't use a string indicator or don't run in highlight execution, you'll never see this anyway (at least on the LAbVIEW side 🙂

Good luck and feel free to repost!

Best Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 11 of 11
(1,005 Views)