delphi串口读写台达plc

时间:2021-12-24 09:51:10
【文件属性】:

文件名称:delphi串口读写台达plc

文件大小:657KB

文件格式:RAR

更新时间:2021-12-24 09:51:10

PLC 台达 DELPHI 通讯 MODBUS

delphi串口读写台达plc PLC台达DELPHI通讯MODBUS procedure TfrmMain.btnReadMClick(Sender: TObject); var sStr:String; i:Integer; begin for i:= 0 to 1279 do Begin kmtPLC.SendData('0102'+IntToHex(i+$800,4)+'0001'); //取输出状态 sStr:=kmtPLC.ReadResFromPort(); if sStr<>'' then Begin memo1.Lines.Add('M'+IntToHex(i,4)+'-'+FormatFloat('0000',i)+'-'+Copy(sStr,1,Length(sStr)-2)); End; End; end; procedure TfrmMain.SpeedButton4Click(Sender: TObject); var sStr:String; begin kmtPLC.SendData('0103'+IntToHex(StrToInt(edtDAddr.Text)+$1000,4)+'0001'); sStr:=kmtPLC.ReadResFromPort(); if sStr<>'' then Begin edtDValue.Text:=sStr; End; end;


【文件预览】:
demo
----RxTimer.pas(7KB)
----uPublic.dcu(4KB)
----UDeltaPLC.dcu(6KB)
----CRCUnit.dcu(2KB)
----Umail.dfm(9KB)
----uPublic.pas(5KB)
----Project1.res(876B)
----Umail.ddp(51B)
----crc16.pas(4KB)
----RxTimer.dcu(6KB)
----demo()
--------RxTimer.pas(7KB)
--------uPublic.dcu(5KB)
--------UDeltaPLC.dcu(6KB)
--------CRCUnit.dcu(2KB)
--------Umail.dfm(9KB)
--------uPublic.pas(5KB)
--------Project1.res(876B)
--------Umail.ddp(51B)
--------crc16.pas(4KB)
--------RxTimer.dcu(7KB)
--------UDeltaPLC.pas(6KB)
--------Project1.cfg(434B)
--------Umail.~ddp(51B)
--------crc32.dcu(3KB)
--------Pcomm.dll(57KB)
--------Project1.dpr(310B)
--------Pcomm.dcu(7KB)
--------Project1.exe(636KB)
--------Umail.pas(6KB)
--------crc32.pas(8KB)
--------Umail.~dfm(9KB)
--------Umail.dcu(11KB)
--------crc16.dcu(1KB)
--------CRCUnit.pas(4KB)
--------Project1.dof(2KB)
--------Umail.~pas(6KB)
--------Pcomm.pas(10KB)
----UDeltaPLC.pas(6KB)
----Project1.cfg(434B)
----crc32.dcu(3KB)
----Pcomm.dll(57KB)
----Project1.dpr(310B)
----Pcomm.dcu(7KB)
----Project1.exe(626KB)
----Umail.pas(6KB)
----crc32.pas(8KB)
----Umail.dcu(10KB)
----crc16.dcu(1KB)
----CRCUnit.pas(4KB)
----Project1.dof(2KB)
----Pcomm.pas(10KB)

网友评论