Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

R232 communication:RTS, CTS

    It's somewhat shame to ask this kind of question here, since I should be able to find the solution in windows hardware manual, even in CVI context help. However, I'm still confused about a lot of  details, hope somebody could help me on this.
   I'm using the R232 hardware shaking to build a communication between PC and ECM (engine control module) by connecting CTS and RTS lines(LWRS_HWHANDSHAKE_CTS_RTS).I'm wondering whether the cable connection(below) is right or not, also wondering the following description is right or not.
 
A,If the port is opened, the library raises RTS, BUT how about CTS??
 
1, When the PC is receiving msg from ECM:
If the input queue of the port is nearly full, the library lowers RTS.
If the input queue of the port is nearly empty, the library raises RTS.
how about CTS??
2,when the PC is the sender
Only If CTS line is high, it could send the data from the port.
how about RTS??
 
B, If the port is closed, the library lowers RTS BUT how about CTS??.
 
-------------------------------------------------
(PC)              (ECM)           
TxD* 2____________2 RxD
RxD 3____________3 TxD*
RTS* 4____________5 RTS
CTS 5____________4 CTS*
0 Kudos
Message 1 of 5
(4,912 Views)
Forget to talk about DTR, DSR. In the above, no connection between DSR and DTR
0 Kudos
Message 2 of 5
(4,904 Views)

Hi Jacky
This is an old list explaning the 25 to 9 pole change

pin  9 pole subD (male)                25 pole     direction
 1   DCD    Data Carrier Detect         8          to pc
 2   RXD    Receive Data                3          to pc
 3   TXD    Transmit Data               2          from pc
 4   DTR    Data Terminal Ready        20          from pc
 5   SG     Signal Ground               7          both sides
 6   DSR    Data Set Ready              6          to pc
 7   RTS    Request to Send             4          from pc
 8   CTS    Clear to Send               5          to pc
 9   RI     Ring Indicator             22          to pc

(be careful the 25 pole and 9 pole connector have changed 2 and 3)

What you seem to miss is the direction of the signal.
RTS comes from the pc to signal that it is ready to receive
CTS comes from the device to stop sending by the pc
So CTS is controlled by the instrument and the library reacts on that by kleeping its mouth shut

 

greetings from the Netherlands
0 Kudos
Message 3 of 5
(4,902 Views)
Thanks!
0 Kudos
Message 4 of 5
(4,898 Views)
jacky,

Judging from the pinout you provided, the problem I see is that you are swapping lines 4 and 5.  What you need to end up with is the RTS line on your computer connecting to the CTS line on your ECU, and vise versa.  In this manner, when the ECU raises RTS to say it can receive data, this raises CTS on the computer, signalling that data can be sent.

Let us know if this solves the problem you are seeing,

Jason S.
National Instruments
0 Kudos
Message 5 of 5
(4,885 Views)