Showing results for 
Search instead for 
Did you mean: 

RS-232 through TCP/IP with LabView

Go to solution



I currently have a serial device being read through a hardware RS232 to TCP/IP converter.

On the computer with labview I use a third party virtual serial port that reads the TCP/IP data and converts it pack to COM port data.

I then read the COM port normally with VISA.


I would like to remove the third party TCP/IP to RS232 software and have LabView read the TCP/IP port and convert to serial.


How would I achieve this?


More details on the hardware and 3rd party sofware;


More details ont he labview code here;

0 Kudos
Message 1 of 7

You can do this through VISA as explained here, or using the TCP VIs for which there are examples and help documents.

0 Kudos
Message 2 of 7



But looking for a bit more details about the TCP VI and interfacing it with the VISA VIs for serial.





0 Kudos
Message 3 of 7

It might be possible to capture the TCP/IP traffic using a port sniffer (such as WireShark) and deduce required protocol.


WireShark is free. 😉

0 Kudos
Message 4 of 7
Accepted by hydzik
I don't think it's as complicated as you seem to expect. Try the VISA TCP approach. Create a VISA TCP resource, in raw mode, as explained in the white paper. Take your existing code, replace the COM resource with the new TCP one, remove the serial port configuration, and it might just work. Make sure you close the resource when you stop there program.

If you want to go with the TCP functions, take a look at the examples. You open a connection, read and write strings to it exactly as you would with a serial port, and close it when you're done.
0 Kudos
Message 5 of 7

thanks, you were right, I didn't think it was so simple, literally changing the VISA VIs to TCP equivalent.


thanks all for your help.

0 Kudos
Message 6 of 7

Check your settings for your converter. Most Serial port Servers have different modes of operation. (Raw Data, TCP or UDP, ect)  This would allow you to directly access the serial port and would remove the requirement of a virtual port. I use B&B electronics. They have a good priced serial port servers for around $125. 

0 Kudos
Message 7 of 7