全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:2188
推到 Plurk!
推到 Facebook!

如何透過DCB直接控制RTS和 DTR訊號?

尚未結案
Boy
一般會員


發表:5
回覆:10
積分:3
註冊:2002-11-30

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-08-17 18:17:32 IP:203.73.xxx.xxx 未訂閱
如何透過DCB直接控制RTS和DTR訊號? 我的應用必須依照特殊時序控制RTS和DTR訊號的High/Low ! Jeffrey Chang
------
Jeffrey Chang
andychang1690
資深會員


發表:20
回覆:694
積分:442
註冊:2003-03-14

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-08-18 08:33:35 IP:219.132.xxx.xxx 未訂閱
Boy:請參考EscapeCommFunction
見BCB->Help->Windows SDK
引用線上說明如下:
The EscapeCommFunction function directs a specified communications device to perform an extended function.     BOOL EscapeCommFunction(        HANDLE hFile,        // handle to communications device
    DWORD dwFunc         // extended function to perform
   );        
     Parameters    hFile    Identifies the communications device. The CreateFile function returns this handle.     dwFunc    Specifies the code of the extended function to perform. This parameter can be one of the following values:     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.    Return Values    If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.     See Also
ClearCommBreak, CreateFile, SetCommBreak 
請參考!
Andy Chang
------
Andy Chang
系統時間:2024-04-30 2:04:55
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!