Showing results for 
Search instead for 
Did you mean: 

Problems using LabView to write to a serial port on 1 pc and LabView to read from the serial port on another pc connected by 9 pin RS232

Hi there, I am new to serial communications and am trying to connect 2 pc's via the serial port (COM1). I am using the example LabVIEW<-> Serial vi shipped with LabView 6i, and basically running this example in continuous mode to read data on 1 pc and then running the vi in write mode to send a test string from the other pc, but it doesn't work! I have ensures that the baud rate, stop bits etc are the same and have carried out the loopback test at both ends. I would be really grateful to anyone who could help me with this!
0 Kudos
Message 1 of 4
Are you using a NULL modem adapter? Serial ports come in two flavors, DTE and DCE. Data Terminal Equipment is the side that provides the user display (the PC). Data Communication Equipment is the side that transmits the information (typcially a modem). One transmits on pin 2 and receives on pin 3. The other is the opposite. In order to connect two DTE devices together, you have to use a null modem adapter, or swap the wires manually.

If you purchase an RS232 tester that has the LEDs on it, you will be able to confirm that each side drives the proper pins.

- Michael
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 4.0, now with a new Interactive Window Manager!
Review the top 24 Impossible with LabVIEW Categories
0 Kudos
Message 2 of 4

The best thing to do here it to test each part separately, a terminal
programme like Docklight ( ) will certainly
help you in your investigations.

1. Make sure that you use a null modem cable between the 2 PC's
2 --- 3
3 --- 2
5 --- 5

2. Use on PC1 the Labview program which will send something, start the
terminal program on PC2 in order to test the communication which is
going out from the PC1. (With the terminal program try several speeds,
parity options, ... in order to see what happens and in order to
confirm your communication settings on PC1)

3. Start the terminal program on PC1 and the other Labview Program on
PC2, on PC1 you can simulate the behaviour from PC1 from step 2, and
see the answer from PC2.

. When you are sure that both parts are now working fine, the first
Labview Program on PC1 and the second Labview Program on PC2, you can
connect them together. In order to see the communication which passed
through the RS232 line, you can use a third PC with two serial ports
in order to monitor the communication between the two PC's. Docklight
will also be able to do this.
0 Kudos
Message 3 of 4
Thanks very much but I've sorted the problem now, I wasn't using a null modem cable (rather stupidly!), and the system now works fine.

0 Kudos
Message 4 of 4