USEGEAR

导航

和大华电子称进行对数据通讯

//16进制命令:02+!0J0001A+0d0a03 

s:= '0221304A30303031410d0a03'; 

      SetLength(mybuff,12); 

     mybuff[0] := StrToInt('$02') ; 

     mybuff[1] := StrToInt('$21') ; 

     mybuff[2] := StrToInt('$30') ; 

     mybuff[3] := StrToInt('$4a') ; 

     mybuff[4] := StrToInt('$30') ; 

     mybuff[5] := StrToInt('$30') ; 

     mybuff[6] := StrToInt('$30') ; 

     mybuff[7] := StrToInt('$31') ; 

     mybuff[8] := StrToInt('$41') ; 

     mybuff[9] := StrToInt('$0d') ; 

     mybuff[10] := StrToInt('$0a') ; 

     mybuff[11] := StrToInt('$03') ; 

     if IdTCPClient.Connected then    IdTCPClient.IOHandler.Write(mybuff); 

     tmpstr :=IdTCPClient.IOHandler.ReadLn();

 

posted on 2013-09-05 18:13  USEGEAR  阅读(1345)  评论(0编辑  收藏  举报