A
ausable
Unregistered / Unconfirmed
GUEST, unregistred user!
我开始用mscomm控件的oncomm事件触发接收,当用于MODEM与下位机单片机通讯时出现所发字节串断断续续;
后来改用打开句柄方式:
hComm:=createfile(pchar(temp),Generic_read or Generic_write,0,nil,
open_existing,0,0);
...
writefile(hcomm,pDataToWrite^,length(s),len,0);//发命令
...
ReadFile(HComm,InputBuffer,CommState.cbInQue,dwNumberOfBytesRead,0))
现象依旧
后来采用句柄的异步通讯方式:
hComm:=createfile(pchar(temp),Generic_read or Generic_write,0,nil,
open_existing,FILE_FLAG_OVERLAPPED,0);
...
writefile(hcomm,pstr^,sflen,len,@Write_Os); //发送
...
ReadFile(aHComm,InputBuffer,CommState.cbInQue,dwNumberOfBytesRead,@Read_Os));
现象依旧
采用异步方式后,直接用串口发送命令,不会出现断断续续,而用步方式则会
如何解决连续发送不断续???
HELP ME.
后来改用打开句柄方式:
hComm:=createfile(pchar(temp),Generic_read or Generic_write,0,nil,
open_existing,0,0);
...
writefile(hcomm,pDataToWrite^,length(s),len,0);//发命令
...
ReadFile(HComm,InputBuffer,CommState.cbInQue,dwNumberOfBytesRead,0))
现象依旧
后来采用句柄的异步通讯方式:
hComm:=createfile(pchar(temp),Generic_read or Generic_write,0,nil,
open_existing,FILE_FLAG_OVERLAPPED,0);
...
writefile(hcomm,pstr^,sflen,len,@Write_Os); //发送
...
ReadFile(aHComm,InputBuffer,CommState.cbInQue,dwNumberOfBytesRead,@Read_Os));
现象依旧
采用异步方式后,直接用串口发送命令,不会出现断断续续,而用步方式则会
如何解决连续发送不断续???
HELP ME.