From d731092c2907713c3c559ced5a3a28890d6749f1 Mon Sep 17 00:00:00 2001 From: Jeremy Wu <54832272+JeremyWu917@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:22:41 +0800 Subject: [PATCH 1/2] chore: add some exegesis and fix typo --- IoTClient/Clients/PLC/SiemensClient.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IoTClient/Clients/PLC/SiemensClient.cs b/IoTClient/Clients/PLC/SiemensClient.cs index e1c89f9..08b31eb 100644 --- a/IoTClient/Clients/PLC/SiemensClient.cs +++ b/IoTClient/Clients/PLC/SiemensClient.cs @@ -536,9 +536,9 @@ public Result>> ReadBoolean(string address, usho } /// - /// + /// 读取Byte /// - /// + /// 地址 /// public Result ReadByte(string address) { @@ -1014,7 +1014,7 @@ public Result ReadString(string address, ushort length) /// 批量写入 /// TODO 可以重构后面的Write 都走BatchWrite /// - /// + /// 地址和值 /// private Result BatchWrite(Dictionary addresses) { @@ -1138,10 +1138,10 @@ private Result BatchWrite(Dictionary addresses) } /// - /// 分批写入,默认按10个地址打包读取 + /// 分批写入,默认按10个地址打包写入 /// /// 地址集合 - /// 批量读取数量 + /// 批量写入的数量 /// public Result BatchWrite(Dictionary addresses, int batchNumber = 10) { From 63d8099b1337356d882dc440cb121cec6ab73f58 Mon Sep 17 00:00:00 2001 From: Jeremy Wu <54832272+JeremyWu917@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:31:02 +0800 Subject: [PATCH 2/2] chore: add some exegesis --- IoTClient/Clients/PLC/OmronFinsClient.cs | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/IoTClient/Clients/PLC/OmronFinsClient.cs b/IoTClient/Clients/PLC/OmronFinsClient.cs index b31a0fc..cc87813 100644 --- a/IoTClient/Clients/PLC/OmronFinsClient.cs +++ b/IoTClient/Clients/PLC/OmronFinsClient.cs @@ -66,12 +66,12 @@ public class OmronFinsClient : SocketBase, IEthernetClient private byte DA1 { get; set; } = 0x01; /// - /// + /// 构造函数 /// - /// - /// - /// - /// + /// 主机地址 + /// 端口 + /// 超时时间,默认1500毫秒 + /// 字节序格式 public OmronFinsClient(string ip, int port = 9600, int timeout = 1500, EndianFormat endianFormat = EndianFormat.CDAB) { if (!IPAddress.TryParse(ip, out IPAddress address)) @@ -144,7 +144,7 @@ protected override Result Connect() /// /// 发送报文,并获取响应报文(建议使用SendPackageReliable,如果异常会自动重试一次) /// - /// + /// 指令集 /// public override Result SendPackageSingle(byte[] command) { @@ -190,8 +190,8 @@ public override Result SendPackageSingle(byte[] command) /// 读取数据 /// /// 地址 - /// - /// + /// 长度 + /// 类型 /// 返回值是否设置大小端 /// public Result Read(string address, ushort length, bool isBit = false, bool setEndian = true) @@ -289,9 +289,9 @@ private Result ReadBoolean(int startAddressInt, int addressInt, byte[] val } /// - /// 读取byte + /// 读取Byte /// - /// + /// 地址 /// public Result ReadByte(string address) { @@ -301,7 +301,7 @@ public Result ReadByte(string address) /// /// 读取Int16 /// - /// + /// 地址 /// public Result ReadInt16(string address) { @@ -823,9 +823,9 @@ public Result Write(string address, object value, DataTypeEnum type) /// /// 地址信息解析 /// - /// - /// - /// + /// 地址 + /// 类型 + /// 值 /// private OmronFinsAddress ConvertArg(string address, DataTypeEnum dataType = DataTypeEnum.None, bool isBit = false) {