链接的时候是通过串口通讯的,你看看串口通讯的程序就可以了。 返回的数据怎么定义的?每个数据是多少位十六进制数??procedure Tfrm_icread.Comm1ReceiveData(Sender: TObject; Buffer: Pointer; BufferLength: Word); var tmpArray:array[0..256] of Byte; ArraySize: DWORD; Count:DWORD; tmpStr:string; i:integer; pStr:PChar; begin //-------------接受返回信息----------- pStr:=Buffer; tmpStr:=string(pStr); Dec(PStr); tempb:=''; for i:=0 to bufferlength-1 do begin inc(PStr); tmpArray[i]:=Byte(PSTR^); tempb:=tempb+IntToHEX(Ord(tmpArray[i]),2); end;pStr:= Buffer;
返回的数据怎么定义的?每个数据是多少位十六进制数??procedure Tfrm_icread.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var tmpArray:array[0..256] of Byte;
ArraySize: DWORD;
Count:DWORD;
tmpStr:string;
i:integer;
pStr:PChar;
begin //-------------接受返回信息-----------
pStr:=Buffer;
tmpStr:=string(pStr);
Dec(PStr);
tempb:='';
for i:=0 to bufferlength-1 do
begin
inc(PStr);
tmpArray[i]:=Byte(PSTR^);
tempb:=tempb+IntToHEX(Ord(tmpArray[i]),2); end;pStr:= Buffer;
就是字节流。
在作是String就可以了。
谁有关于西门子s7-300的相关协议,能给我一份