連線定義
串行直連電纜用兩台計算機的直接相連,電纜兩端的插頭一頭是
9 針母插頭,另一頭是 25 針母插頭:

上兩圖均為母頭俯視圖
9針母頭管腳定義:
| 管腳號 |
管腳中英文名 |
| 1 |
Data Carrier Detect
數據載波檢測 |
| 2 |
Receive Data
接收數據 |
| 3 |
Transmit Data
發送數據 |
| 4 |
Data Terminal Ready
數據終端就緒 |
| 5 |
System Ground
信號地 |
| 6 |
Data Set Ready
數據設備就緒 |
| 7 |
Request to Send
請求發送 |
| 8 |
Clear to Send
清除發送 |
25針母頭管腳定義(其中在該連接中,只有8根針起作用):
| 管腳號 |
管腳中英文名 |
| 2 |
Transmit Data
發送數據 |
| 3 |
Receive Data
接收數據 |
| 4 |
Request to Send
請求發送 |
| 5 |
Clear to Send
清除發送 |
| 6 |
Data Set Ready
數據設備就緒 |
| 7 |
System Ground
信號地 |
| 8 |
Data Carrier Detect
數據載波檢測 |
| 20 |
Data Terminal Ready
數據終端就緒 |
引腳定義
當連接一頭為9針母插頭而一頭為25針時母插頭時,線路連接應該為:
|
D-Sub 9 |
D-Sub 25 |
|
| Data Carrier Detect |
1 |
4+5 |
Request to Send+Clear
to Send |
| Receive Data |
2 |
2 |
Transmit Data |
| Transmit Data |
3 |
3 |
Receive Data |
| Data Terminal Ready |
4 |
6 |
Data Set Ready |
| System Ground |
5 |
7 |
System Ground |
| Request to Send+Clear
to Send |
7+8 |
8 |
Data Carrier Detect |
| Data Set Ready |
6 |
20 |
Data Terminal Ready |
| RI |
9 |
9 |
RI |

當連接兩頭均為9針母插頭時,線路連接應該為:
|
D-Sub 9 |
D-Sub 9 |
|
| Carrier Detect |
1 |
7+8 |
Request to Send+Clear
to Send |
| Receive Data |
2 |
3 |
Transmit Data |
| Transmit Data |
3 |
2 |
Receive Data |
| Data Terminal Ready |
4 |
6 |
Data Set Ready |
| System Ground |
5 |
5 |
System Ground |
| Data Set Ready |
6 |
4 |
Data Terminal Ready |
| Request to Send+Clear
to Send |
7+8 |
1 |
Carrier Detect |
| RI |
9 |
9 |
RI |

備注:NC表示另外一頭對應的針腳自己連接
另外為了保証串口物理上可以正常工作,可以通過使用制作堵頭來測試該口是否正常:

將堵頭插入到要測試的串口上,然按照下面的netterm設置,連接以,在netterm輸入字符,若屏幕上顯示了輸入的字符,則說明該串口物理正常。
軟件配置說明
一、NETTERM設置說明:
Emulation(模擬型態): ANSI
Connection(連接型態):Modem(調制解調器)
Keys(鍵盤定義):Default
其中 調制解調器設置參數為:
port(端口):COM1(或COM2 取決連接線連接在哪個端口上)
Baud Rate(波特率):9600
Data Bits(資料位):8
Parity(奇偶):None(無)
Stop Bits(停止位):1
Maxium Connect(撥接時最長等待時間):60
控制部分設置中:只有 Direct Line使能(也就是在check box中打上對號,其他的都不選)
其他參數保持缺省不要修改
二、linux環境下Mgetty設置說明:
首先需要安裝Mgetty軟件包,在Redhat的光盤中有該軟件的RPM包只需要在該RPM包所在目錄下運行:
rpm -ivh mgetty-1.1.3-i386.rpm
即可
其中需要修改的設置為:
在/etc/目錄下的 inittab 配置文件最加如一行如下:
S0:345:respawn:/sbin/mgetty -r -x 9 ttyS1
其中最一個參數ttyS1應該根據你連接的linux機器哪個端口來決定,若連接到com1則應該將該參數修改為ttyS0
若為COM2則應該為ttyS1
另外在/etc/mgetty-sendfax目錄下有mgetty.config文件:
內容應該為:
#
# mgetty configuration file
#
# this is a sample configuration file, see mgetty.info for details
#
# comment lines start with a "#", empty lines are ignored
# ----- global section -----
#
# In this section, you put the global defaults, per-port stuff is below
# set the global debug level to "4" (default from policy.h)
debug 9
# access the modem(s) with 38400 bps
speed 9600
port ttyS1
direct yes
其中若你連接到inux機器的com1口的話,則需要將
port ttyS1
修改為
port ttyS0
其他保持不變
注:其中mgetty程序的log文件為/var/log/目錄下的mget*文件,可以查看該文件來判斷問題所在
(http://www.fanqiang.com)
進入【