0

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.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Peter
  • 117
  • 3
  • 9

1 Answers1

3

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

DusteD
  • 1,400
  • 10
  • 14
  • First of all thank you for your answer. So the problem is that the cable i am using doesnt switch rx and tx and neither does the adapter right ? – Peter Nov 13 '14 at 20:01
  • This is the adapter that i use: http://pdf.datasheetarchive.com/indexerfiles/Scans-021/ScansEX33303.pdf (patent 5199906) It appear it is straight through. You have also said that female-style connectors have rx/tx switched. Both of the ports on my card are female. Does that mean the are switched twice ? And with a straight through cable the Rx goes to RX instead of TX. Is it going to be ok if i get a crossover adapter converter ? Thnx. – Peter Nov 13 '14 at 20:47
  • Well, you need to have rx-tx switched relative to the receiving end, so yes, that's basically what it means, since both your cards are the DTE type, any straight through connection will connect tx to tx and rx to rx, which won't work. If you get converter that crosses them, it will work. If you have the means,you can also cut the cable in two and switch those connections. – DusteD Nov 14 '14 at 09:54