Check if 2 serial ports work correctly

194 views Asked by At

I am struggling to send some bytes from one serial port to another on the same computer. I use this card: http://www.nisuta.com/images/productos/grandes/NS4037.jpg (sun1889).

I connect them with the following equipment cable: http://www.weisd.com/store2/QVSCC317-06_LR.jpg and adapter: http://www.networktechinc.com/nti/images/items/db9-sl-mf.jpg

I have written a program in java using JSSC library that's supposed to send the data from one to another exactly as shown in JSSC examples. COM3 reads and COM4 writes.

I have also run 2 instances of JSSC-Terminal assigning com3 to the first and com4 to the other and then sending some chars, but that didn't work either.

How can check that the ports work properly and they don't malfunction? Device manager shows 3 ports COM1 , COM3, COM4. COM1 is the port that exists on motherboard.

1

There are 1 answers

3
DusteD On BEST ANSWER

Have you checked that the pinout of that cable is correct for your application ? You need a so-called "null-modem" cable, which will cross rx and tx. This is needed so that PortA.tx (transmit) goes to PortB.rx (Recieve)

http://ftp1.digi.com/support/images/nmodems.gif

There is a good chance that the cable you have is a "straight through" type, since equipment with a female-style connector will have it's rx/tx switched around compared to male-style connectors. (Devices with one type connector is called DTE and DCE)

Here is a good example.

http://www.bb-elec.com/Images/whitepaper-images/WhatIsRS232-DCE-DTEPinDiagram.aspx http://www.wut.de/kpics/e-8wwww-17-grus-000.gif