W
wally
Unregistered / Unconfirmed
GUEST, unregistred user!
在用SPCOMM控件作串口通信时,接受数据可以通过OnReceiveData函数来执行,
1. The input buffer contains received data and
2. more than a limit size or
3. read time-out
以上三个事件都将激活OnReceiveData,我想知道如果超时的话是不是也收到数据,是什么呢?
还有ReadIntervalTimeout,ReadTotolTimeout,,ReadTotolTimeoutMultiplier分别应该怎么设置,我的程序在收数据上一直有问题。
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var receive:byte;
begin
//我的下位机每次只发送一个数据,所以我只接受一个数据
move(buffer^,receive,1);
showmessage(inttostr(receive)) ;
end;
1. The input buffer contains received data and
2. more than a limit size or
3. read time-out
以上三个事件都将激活OnReceiveData,我想知道如果超时的话是不是也收到数据,是什么呢?
还有ReadIntervalTimeout,ReadTotolTimeout,,ReadTotolTimeoutMultiplier分别应该怎么设置,我的程序在收数据上一直有问题。
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var receive:byte;
begin
//我的下位机每次只发送一个数据,所以我只接受一个数据
move(buffer^,receive,1);
showmessage(inttostr(receive)) ;
end;