請問如何將RS232的第一腳恆設為High |
尚未結案
|
haynos hu
一般會員 發表:1 回覆:2 積分:0 註冊:2003-09-12 發送簡訊給我 |
|
haynos hu
一般會員 發表:1 回覆:2 積分:0 註冊:2003-09-12 發送簡訊給我 |
|
avex
初階會員 發表:19 回覆:49 積分:43 註冊:2003-03-28 發送簡訊給我 |
很簡單啊, 在你的 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 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |