LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS-232 through TCP/IP with LabView

Solved!
Go to solution

Hello

 

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;

thydzik.com/monitor-cms2000-inverter-via-tcpip-usr-tcp232-e4-rs232ip-convertor/

 

More details ont he labview code here;

thydzik.com/log-solar-generated-to-pvoutput-with-labview/

0 Kudos
Message 1 of 7
(6,111 Views)

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
(6,072 Views)

thanks.

 

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
(6,050 Views)

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
(6,039 Views)
Solution
Accepted by topic author 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.
Message 5 of 7
(6,028 Views)

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
(6,014 Views)

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
(5,927 Views)