Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add some exegesis and fix typo #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions IoTClient/Clients/PLC/OmronFinsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public class OmronFinsClient : SocketBase, IEthernetClient
private byte DA1 { get; set; } = 0x01;

/// <summary>
///
/// 构造函数
/// </summary>
/// <param name="ip"></param>
/// <param name="port"></param>
/// <param name="timeout"></param>
/// <param name="endianFormat"></param>
/// <param name="ip">主机地址</param>
/// <param name="port">端口</param>
/// <param name="timeout">超时时间,默认1500毫秒</param>
/// <param name="endianFormat">字节序格式</param>
public OmronFinsClient(string ip, int port = 9600, int timeout = 1500, EndianFormat endianFormat = EndianFormat.CDAB)
{
if (!IPAddress.TryParse(ip, out IPAddress address))
Expand Down Expand Up @@ -144,7 +144,7 @@ protected override Result Connect()
/// <summary>
/// 发送报文,并获取响应报文(建议使用SendPackageReliable,如果异常会自动重试一次)
/// </summary>
/// <param name="command"></param>
/// <param name="command">指令集</param>
/// <returns></returns>
public override Result<byte[]> SendPackageSingle(byte[] command)
{
Expand Down Expand Up @@ -190,8 +190,8 @@ public override Result<byte[]> SendPackageSingle(byte[] command)
/// 读取数据
/// </summary>
/// <param name="address">地址</param>
/// <param name="length"></param>
/// <param name="isBit"></param>
/// <param name="length">长度</param>
/// <param name="isBit">类型</param>
/// <param name="setEndian">返回值是否设置大小端</param>
/// <returns></returns>
public Result<byte[]> Read(string address, ushort length, bool isBit = false, bool setEndian = true)
Expand Down Expand Up @@ -289,9 +289,9 @@ private Result<bool> ReadBoolean(int startAddressInt, int addressInt, byte[] val
}

/// <summary>
/// 读取byte
/// 读取Byte
/// </summary>
/// <param name="address"></param>
/// <param name="address">地址</param>
/// <returns></returns>
public Result<byte> ReadByte(string address)
{
Expand All @@ -301,7 +301,7 @@ public Result<byte> ReadByte(string address)
/// <summary>
/// 读取Int16
/// </summary>
/// <param name="address"></param>
/// <param name="address">地址</param>
/// <returns></returns>
public Result<short> ReadInt16(string address)
{
Expand Down Expand Up @@ -823,9 +823,9 @@ public Result Write(string address, object value, DataTypeEnum type)
/// <summary>
/// 地址信息解析
/// </summary>
/// <param name="address"></param>
/// <param name="dataType"></param>
/// <param name="isBit"></param>
/// <param name="address">地址</param>
/// <param name="dataType">类型</param>
/// <param name="isBit"></param>
/// <returns></returns>
private OmronFinsAddress ConvertArg(string address, DataTypeEnum dataType = DataTypeEnum.None, bool isBit = false)
{
Expand Down
10 changes: 5 additions & 5 deletions IoTClient/Clients/PLC/SiemensClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,9 @@ public Result<List<KeyValuePair<string, bool>>> ReadBoolean(string address, usho
}

/// <summary>
///
/// 读取Byte
/// </summary>
/// <param name="address"></param>
/// <param name="address">地址</param>
/// <returns></returns>
public Result<byte> ReadByte(string address)
{
Expand Down Expand Up @@ -1014,7 +1014,7 @@ public Result<byte[]> ReadString(string address, ushort length)
/// 批量写入
/// TODO 可以重构后面的Write 都走BatchWrite
/// </summary>
/// <param name="addresses"></param>
/// <param name="addresses">地址和值</param>
/// <returns></returns>
private Result BatchWrite(Dictionary<string, object> addresses)
{
Expand Down Expand Up @@ -1138,10 +1138,10 @@ private Result BatchWrite(Dictionary<string, object> addresses)
}

/// <summary>
/// 分批写入,默认按10个地址打包读取
/// 分批写入,默认按10个地址打包写入
/// </summary>
/// <param name="addresses">地址集合</param>
/// <param name="batchNumber">批量读取数量</param>
/// <param name="batchNumber">批量写入的数量</param>
/// <returns></returns>
public Result BatchWrite(Dictionary<string, object> addresses, int batchNumber = 10)
{
Expand Down