实时串口通信的问题(我使用的是SPComm)
我用SPComm做的一个实时串口通信的程序。总觉得效果不理想。
我处理串口通信的代码如下:
const
DELAYBEFOREPROC=200;
var
comm: TComm;
g_sendData: Array[1..100] of char;
procedure executeComm(dataLength: Integer);
begin
if not comm.SendDataEmpty then
sleep(100);
comm.WriteCommData(g_sendData,dataLength);
//iDataLength := 0;
sleep(DELAYBEFOREPROC);
application.ProcessMessages;
end;
请大家帮忙下,怎么样才能提高效率?