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! Thanks Em
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.
The best thing to do here it to test each part separately, a terminal programme like Docklight ( http://www.docklight.de ) 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.
4 . 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.