delphi串口读写台达plcPLC台达DELPHI通讯MODBUSprocedureTfrmMain.btnReadMClick(Sender:TObject);varsStr:String;i:Integer;beginfori:=0to1279doBeginkmtPLC.SendData('0102'+IntToHex(i+$800,4)+'0001');//取输出状态sStr:=kmtPLC.ReadResFromPort();ifsStr''then