線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1155
推到 Plurk!
推到 Facebook!

請問如何將RS232的第一腳恆設為High

尚未結案
haynos hu
一般會員


發表:1
回覆:2
積分:0
註冊:2003-09-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-09-12 19:57:08 IP:218.164.xxx.xxx 未訂閱
各位大大, 我使用Win API作RS232傳輸,但現在需要將COM Port上的第一支腳(DSR)恆設為High,請問該如何設定?
haynos hu
一般會員


發表:1
回覆:2
積分:0
註冊:2003-09-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-09-12 22:20:45 IP:218.164.xxx.xxx 未訂閱
訂正: 電路圖看錯了,應該是DTR腳且不是第一腳,知道的請教教我,謝謝!
avex
初階會員


發表:19
回覆:49
積分:43
註冊:2003-03-28

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-09-26 18:12:32 IP:218.163.xxx.xxx 未訂閱
很簡單啊, 在你的 DCB 的 fDtrControl 上將其設為 0 (DTR_CONTROL_DISABLE) 然後使用 EscapeCommFunction , 將其設為 EscapeCommFunction(hFile, SETDTR); 即可 [底下參數提供參考, 詳見 MSDN] Value Meaning CLRDTR Clears the DTR (data-terminal-ready) signal. CLRRTS Clears the RTS (request-to-send) signal. SETDTR Sends the DTR (data-terminal-ready) signal. SETRTS Sends the RTS (request-to-send) signal. SETXOFF Causes transmission to act as if an XOFF character has been received. SETXON Causes transmission to act as if an XON character has been received. SETBREAK Suspends character transmission and places the transmission line in a break state until the ClearCommBreak function is called (or EscapeCommFunction is called with the CLRBREAK extended function code). The SETBREAK extended function code is identical to the SetCommBreak function. Note that this extended function does not flush data that has not been transmitted. CLRBREAK Restores character transmission and places the transmission line in a nonbreak state. The CLRBREAK extended function code is identical to the ClearCommBreak function.
haynos hu
一般會員


發表:1
回覆:2
積分:0
註冊:2003-09-12

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-09-27 23:03:52 IP:61.223.xxx.xxx 未訂閱
瞭解,感謝 avex 兄!
系統時間:2024-04-18 9:03:32
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!