C
chukaiwang
Unregistered / Unconfirmed
GUEST, unregistred user!
最近在做医院一台Elec 2010 (电化学发光)仪器的数据接受..每次发接受的数据解码出来都不对...请各位帮忙指导一下...
procedure TTestComFrm.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
i:integer;
viewstring:string;
rbuf:array[1..8] of byte;
begin
//=============================================
viewstring:='' ;
move(buffer^,pchar(@rbuf)^,bufferlength);
for i:=1 to bufferlength do
viewstring:=viewstring+ inttohex(rbuf,2)+'' ;
viewstring:='接收:'+ viewstring;
memo1.lines.add(viewstring);
memo1.lines.add('');
end;
//=========以下是我的测试记录
我设了断点跟踪
move(buffer^,pchar(@rbuf)^,bufferlength);
这时的值是 0,57,1,85,0,6,0
最后得到的viewstring的值 是'05'
仪器上的输出的结果是 105 1407 CA125 18.06
procedure TTestComFrm.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
i:integer;
viewstring:string;
rbuf:array[1..8] of byte;
begin
//=============================================
viewstring:='' ;
move(buffer^,pchar(@rbuf)^,bufferlength);
for i:=1 to bufferlength do
viewstring:=viewstring+ inttohex(rbuf,2)+'' ;
viewstring:='接收:'+ viewstring;
memo1.lines.add(viewstring);
memo1.lines.add('');
end;
//=========以下是我的测试记录
我设了断点跟踪
move(buffer^,pchar(@rbuf)^,bufferlength);
这时的值是 0,57,1,85,0,6,0
最后得到的viewstring的值 是'05'
仪器上的输出的结果是 105 1407 CA125 18.06