新的daim

1023
nodyang@aliyun.com 4 weeks ago
parent d28d3665fe
commit 9d99f3c577

Binary file not shown.

@ -6768,6 +6768,9 @@
<member name="M:HslCommunication.Core.IReadWriteDevice.ReadFromCoreServerAsync(System.Collections.Generic.IEnumerable{System.Byte[]})">
<inheritdoc cref="M:HslCommunication.Core.IReadWriteDevice.ReadFromCoreServer(System.Collections.Generic.IEnumerable{System.Byte[]})"/>
</member>
<member name="P:HslCommunication.Core.IReadWriteDevice.ByteTransform">
<inheritdoc cref="P:HslCommunication.Core.Device.DeviceCommunication.ByteTransform"/>
</member>
<member name="T:HslCommunication.Core.Net.IReadWriteDeviceStation">
<summary>
用于读写的设备接口,相较于<see cref="T:HslCommunication.Core.IReadWriteDevice"/>,额外增加的一个站号信息的属性,参见 <see cref="P:HslCommunication.Core.Net.IReadWriteDeviceStation.Station"/><br />
@ -10686,7 +10689,7 @@
</member>
<member name="M:HslCommunication.Core.IReadWriteNet.Read``1">
<summary>
读取支持Hsl特性的数据内容该特性为<see cref="T:HslCommunication.Reflection.HslDeviceAddressAttribute"/>详细参考api文档说明<br />
读取支持Hsl特性的数据内容该特性为<see cref="T:HslCommunication.Reflection.HslDeviceAddressAttribute"/>详细参考api文档说明,或是官网的详细文档<br />
Read the data content of the Hsl attribute. The attribute is <see cref="T:HslCommunication.Reflection.HslDeviceAddressAttribute"/>, please refer to the api documentation for details.
</summary>
<typeparam name="T">自定义的数据类型对象</typeparam>
@ -13479,6 +13482,9 @@
Gets the number of pending locks currently entered
</summary>
</member>
<member name="M:HslCommunication.Core.SimpleHybirdLock.ToString">
<inheritdoc/>
</member>
<member name="P:HslCommunication.Core.SimpleHybirdLock.SimpleHybirdLockCount">
<summary>
获取当前HslCommunication组件里正总的所有进入锁的信息<br />
@ -16102,6 +16108,11 @@
Length of data read
</summary>
</member>
<member name="P:HslCommunication.Reflection.HslDeviceAddressAttribute.Encoding">
<summary>
如果关联了字符串类型的数据,则表示指定的字符编码,默认 ASCII 编码
</summary>
</member>
<member name="M:HslCommunication.Reflection.HslDeviceAddressAttribute.#ctor(System.String)">
<summary>
实例化一个地址特性,指定地址信息,用于单变量的数据<br />
@ -16118,14 +16129,21 @@
<param name="deviceType">设备的地址信息</param>
</member>
<member name="M:HslCommunication.Reflection.HslDeviceAddressAttribute.#ctor(System.String,System.Int32)">
<inheritdoc cref="M:HslCommunication.Reflection.HslDeviceAddressAttribute.#ctor(System.String,System.Int32,System.String)"/>
</member>
<member name="M:HslCommunication.Reflection.HslDeviceAddressAttribute.#ctor(System.String,System.Int32,System.String)">
<summary>
实例化一个地址特性,指定地址信息和数据长度,通常应用于数组的批量读取<br />
Instantiate an address feature, specify address information and data length, usually used in batch reading of arrays
</summary>
<param name="address">真实的地址信息</param>
<param name="length">读取的数据长度</param>
<param name="encoding">如果是字符串类型的数据的话,就是字符串编码</param>
</member>
<member name="M:HslCommunication.Reflection.HslDeviceAddressAttribute.#ctor(System.String,System.Int32,System.Type)">
<inheritdoc cref="M:HslCommunication.Reflection.HslDeviceAddressAttribute.#ctor(System.String,System.Int32,System.Type,System.String)"/>
</member>
<member name="M:HslCommunication.Reflection.HslDeviceAddressAttribute.#ctor(System.String,System.Int32,System.Type,System.String)">
<summary>
实例化一个地址特性指定地址信息和数据长度通常应用于数组的批量读取并指定设备的类型可用于不同种类的PLC<br />
Instantiate an address feature, specify address information and data length, usually used in batch reading of arrays,
@ -16134,6 +16152,7 @@
<param name="address">真实的地址信息</param>
<param name="length">读取的数据长度</param>
<param name="deviceType">设备类型</param>
<param name="encoding">如果是字符串类型的数据的话,就是字符串编码</param>
</member>
<member name="M:HslCommunication.Reflection.HslDeviceAddressAttribute.GetDataLength">
<summary>
@ -16145,6 +16164,13 @@
<member name="M:HslCommunication.Reflection.HslDeviceAddressAttribute.ToString">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Reflection.HslDeviceAddressAttribute.GetEncoding">
<summary>
获取当前关联的编码信息,通常用于解析字符串的操作<br />
Gets the encoding information of the current association, usually used for string parsing operations
</summary>
<returns>字符编码信息</returns>
</member>
<member name="T:HslCommunication.Reflection.HslAddressProperty">
<summary>
Hsl相关地址的属性信息
@ -16372,6 +16398,9 @@
<param name="property">属性信息</param>
<returns>设备类型信息</returns>
</member>
<member name="M:HslCommunication.Reflection.HslReflectionHelper.GetHslDeviceAddressAttributeArray(System.Type,System.Reflection.PropertyInfo)">
<inheritdoc cref="M:HslCommunication.Reflection.HslReflectionHelper.GetHslDeviceAddressAttribute(System.Type,System.Reflection.PropertyInfo)"/>
</member>
<member name="M:HslCommunication.Reflection.HslReflectionHelper.Read``1(HslCommunication.Core.IReadWriteNet)">
<summary>
从设备里读取支持Hsl特性的数据内容该特性为<see cref="T:HslCommunication.Reflection.HslDeviceAddressAttribute"/>,详细参考论坛的操作说明。
@ -21329,17 +21358,17 @@
<returns>信息列表</returns>
</member>
<member name="M:HslCommunication.Enthernet.HttpServer.RegisterHttpRpcApi(System.String,System.Object)">
<summary>
注册一个RPC的服务接口可以指定当前的控制器名称以及提供RPC服务的原始对象<br />
Register an RPC service interface, you can specify the current controller name,
and the original object that provides the RPC service
</summary>
<param name="api">前置的接口信息可以理解为MVC模式的控制器</param>
<param name="obj">原始对象信息</param>
<inheritdoc cref="M:HslCommunication.MQTT.MqttServer.RegisterMqttRpcApi(System.String,System.Object)"/>
</member>
<member name="M:HslCommunication.Enthernet.HttpServer.RegisterHttpRpcApi(System.Object)">
<inheritdoc cref="M:HslCommunication.Enthernet.HttpServer.RegisterHttpRpcApi(System.String,System.Object)"/>
</member>
<member name="M:HslCommunication.Enthernet.HttpServer.UnRegisterHttpRpcApi(System.String,System.Object)">
<inheritdoc cref="M:HslCommunication.MQTT.MqttServer.UnRegisterMqttRpcApi(System.String,System.Object)"/>
</member>
<member name="M:HslCommunication.Enthernet.HttpServer.UnRegisterHttpRpcApi(System.Object)">
<inheritdoc cref="M:HslCommunication.MQTT.MqttServer.UnRegisterMqttRpcApi(System.Object)"/>
</member>
<member name="M:HslCommunication.Enthernet.HttpServer.SetLoginAccessControl(HslCommunication.MQTT.MqttCredential[])">
<summary>
设置登录的账户信息,如果需要自己控制,可以自己实现委托<see cref="P:HslCommunication.Enthernet.HttpServer.HandleRequestFunc"/><br />
@ -25707,7 +25736,8 @@
</member>
<member name="P:HslCommunication.Instrument.DLT.DLT645Server.StringReverse">
<summary>
字符串的数据是否发生反转
字符串的数据是否发生反转,默认为 <c>True</c>, 将根据高地位进行翻转操作<br />
Whether the data of the string is reversed or not, the default is <c>True</c>, and the flip operation will be performed according to the high status
</summary>
</member>
<member name="P:HslCommunication.Instrument.DLT.DLT645Server.EnableCodeFE">
@ -25715,7 +25745,8 @@
</member>
<member name="P:HslCommunication.Instrument.DLT.DLT645Server.StationMatch">
<summary>
是否对客户端及主站的站号进行强制校验只有站号匹配才进行返回数据默认为false对站号信息不校验操作
是否对客户端及主站的站号进行强制校验只有两者站号匹配才进行返回数据默认为false对站号信息不校验操作<br />
Whether to forcibly verify the station ids of the client and the master station. The data is returned only when the station ids of the client and master station match. The default value is false
</summary>
</member>
<member name="M:HslCommunication.Instrument.DLT.DLT645Server.ReadDouble(System.String,System.UInt16)">
@ -25732,7 +25763,8 @@
</member>
<member name="M:HslCommunication.Instrument.DLT.DLT645Server.ReadStringArray(System.String)">
<summary>
读取DLT设备的字符串数据信息
根据指定的地址读取DLT设备的字符串格式的数据信息<br />
Read the DLT device data in string format based on the specified address
</summary>
<param name="address">地址信息</param>
<returns>包含字符串结果数组的对象</returns>
@ -27674,9 +27706,6 @@
Get or set whether to use the secure request mode, for some meters, the safe mode is not supported, so you need to set it to <c>False</c>.
</summary>
</member>
<member name="P:HslCommunication.Instrument.DLT.Helper.IDlt698.ByteTransform">
<inheritdoc cref="P:HslCommunication.Core.Device.DeviceCommunication.ByteTransform"/>
</member>
<member name="P:HslCommunication.Instrument.DLT.Helper.IDlt698.CA">
<summary>
客户机地址CA用1字节表示 0表示不关注客户机地址。<br />
@ -28903,6 +28932,15 @@
<member name="M:HslCommunication.LogNet.LogNetBase.RemoveFiltrate(System.String)">
<inheritdoc cref="M:HslCommunication.LogNet.ILogNet.RemoveFiltrate(System.String)"/>
</member>
<member name="M:HslCommunication.LogNet.LogNetBase.HslMessageFormat(HslCommunication.LogNet.HslMessageItem,System.Boolean)">
<summary>
根据需要存储的日志消息,获取实际存储的字符串,重写本方法就可以自定义输出内容<br />
According to the log message that needs to be stored, get the actual stored string, and the rewrite method can customize the output content
</summary>
<param name="hslMessage">等待存储或是输出的日志对象</param>
<param name="writeFile">是否输出到文件里</param>
<returns>最终等待存储的字符串内容</returns>
</member>
<member name="M:HslCommunication.LogNet.LogNetBase.ToString">
<inheritdoc/>
</member>
@ -29908,8 +29946,11 @@
<member name="P:HslCommunication.ModBus.IModbus.IsStringReverse">
<inheritdoc cref="P:HslCommunication.ModBus.ModbusTcpNet.IsStringReverse"/>
</member>
<member name="P:HslCommunication.ModBus.IModbus.ByteTransform">
<inheritdoc cref="P:HslCommunication.Core.Net.NetworkDoubleBase.ByteTransform"/>
<member name="P:HslCommunication.ModBus.IModbus.BroadcastStation">
<summary>
获取或是设置当前广播模式对应的站号,广播模式意味着不接收设备方的数据返回操作,默认为 -1表示不使用广播模式。<br />
Gets or sets the station number corresponding to the current broadcast mode. Broadcast mode means that the data return operation of the device is not received. The default value is -1, indicating that broadcast mode is not used.
</summary>
</member>
<member name="P:HslCommunication.ModBus.IModbus.EnableWriteMaskCode">
<summary>
@ -30550,6 +30591,9 @@
<member name="P:HslCommunication.ModBus.ModbusRtu.EnableWriteMaskCode">
<inheritdoc cref="P:HslCommunication.ModBus.IModbus.EnableWriteMaskCode"/>
</member>
<member name="P:HslCommunication.ModBus.ModbusRtu.BroadcastStation">
<inheritdoc cref="P:HslCommunication.ModBus.IModbus.BroadcastStation"/>
</member>
<member name="P:HslCommunication.ModBus.ModbusRtu.StationCheckMacth">
<summary>
获取或设置当前是否启用站号检查的功能,默认启用,读写数据时将进行站号确认操作,如果需要忽略站号,则设置为 false 即可。<br />
@ -30587,6 +30631,9 @@
and received The data is also only modbus core messages, for example: 01 03 02 00 00, CRC has been successfully checked and removed, so you need to pay attention when parsing.
</remarks>
</member>
<member name="M:HslCommunication.ModBus.ModbusRtu.ReadFromCoreServerAsync(System.Byte[])">
<inheritdoc cref="M:HslCommunication.ModBus.ModbusRtu.ReadFromCoreServer(System.Byte[])"/>
</member>
<member name="M:HslCommunication.ModBus.ModbusRtu.ReadCoil(System.String)">
<inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadCoil(System.String)"/>
</member>
@ -30770,6 +30817,9 @@
<member name="P:HslCommunication.ModBus.ModbusRtuOverTcp.EnableWriteMaskCode">
<inheritdoc cref="P:HslCommunication.ModBus.IModbus.EnableWriteMaskCode"/>
</member>
<member name="P:HslCommunication.ModBus.ModbusRtuOverTcp.BroadcastStation">
<inheritdoc cref="P:HslCommunication.ModBus.IModbus.BroadcastStation"/>
</member>
<member name="M:HslCommunication.ModBus.ModbusRtuOverTcp.TranslateToModbusAddress(System.String,System.Byte)">
<inheritdoc cref="M:HslCommunication.ModBus.IModbus.TranslateToModbusAddress(System.String,System.Byte)"/>
</member>
@ -30782,6 +30832,12 @@
<member name="M:HslCommunication.ModBus.ModbusRtuOverTcp.UnpackResponseContent(System.Byte[],System.Byte[])">
<inheritdoc/>
</member>
<member name="M:HslCommunication.ModBus.ModbusRtuOverTcp.ReadFromCoreServer(System.Byte[])">
<inheritdoc/>
</member>
<member name="M:HslCommunication.ModBus.ModbusRtuOverTcp.ReadFromCoreServerAsync(System.Byte[])">
<inheritdoc cref="M:HslCommunication.ModBus.ModbusRtuOverTcp.ReadFromCoreServer(System.Byte[])"/>
</member>
<member name="M:HslCommunication.ModBus.ModbusRtuOverTcp.ReadCoil(System.String)">
<inheritdoc cref="M:HslCommunication.ModBus.ModbusTcpNet.ReadCoil(System.String)"/>
</member>
@ -31193,6 +31249,9 @@
<member name="P:HslCommunication.ModBus.ModbusTcpNet.IsCheckMessageId">
<inheritdoc cref="P:HslCommunication.Core.IMessage.ModbusTcpMessage.IsCheckMessageId"/>
</member>
<member name="P:HslCommunication.ModBus.ModbusTcpNet.BroadcastStation">
<inheritdoc cref="P:HslCommunication.ModBus.IModbus.BroadcastStation"/>
</member>
<member name="P:HslCommunication.ModBus.ModbusTcpNet.MessageId">
<summary>
获取modbus协议自增的消息号你可以自定义modbus的消息号的规则详细参见<see cref="T:HslCommunication.ModBus.ModbusTcpNet"/>说明,也可以查找<see cref="T:HslCommunication.BasicFramework.SoftIncrementCount"/>说明。<br />
@ -32014,6 +32073,12 @@
Get all Topic information that the current client object has subscribed to
</summary>
</member>
<member name="P:HslCommunication.MQTT.MqttClient.Tag">
<summary>
获取或设置当前客户端关联的自定义的对象内容<br />
Gets or sets the custom object content associated with the current client
</summary>
</member>
<member name="M:HslCommunication.MQTT.MqttClient.ToString">
<inheritdoc/>
</member>
@ -33379,28 +33444,37 @@
<member name="M:HslCommunication.MQTT.MqttServer.RegisterMqttRpcApi(System.String,System.Object,HslCommunication.Reflection.HslMqttPermissionAttribute)">
<summary>
注册一个RPC的服务接口可以指定当前的控制器名称以及提供RPC服务的原始对象指定统一的权限控制。<br />
Register an RPC service interface, you can specify the current controller name,
and the original object that provides the RPC service, Specify unified access control
Register an RPC service interface, you can specify the current controller name, and the original object that provides the RPC service, Specify unified access control
</summary>
<remarks>
如果设置了<paramref name="permissionAttribute"/>的参数信息那么请确保调用时获取了企业商业授权的权限否则只能使用24小时然后因为权限问题报错。
</remarks>
<param name="api">前置的接口信息可以理解为MVC模式的控制器</param>
<param name="obj">原始对象信息</param>
<param name="obj">原始对象信息,也可以是类型对象本身</param>
<param name="permissionAttribute">统一的权限访问配置,将会覆盖单个方法的权限控制。</param>
</member>
<member name="M:HslCommunication.MQTT.MqttServer.RegisterMqttRpcApi(System.String,System.Object)">
<summary>
注册一个RPC的服务接口可以指定当前的控制器名称以及提供RPC服务的原始对象<br />
Register an RPC service interface, you can specify the current controller name,
and the original object that provides the RPC service
Register an RPC service interface, you can specify the current controller name, and the original object that provides the RPC service
</summary>
<param name="api">前置的接口信息可以理解为MVC模式的控制器</param>
<param name="obj">原始对象信息</param>
<param name="obj">原始对象信息,也可以是类型对象本身</param>
</member>
<member name="M:HslCommunication.MQTT.MqttServer.RegisterMqttRpcApi(System.Object)">
<inheritdoc cref="M:HslCommunication.MQTT.MqttServer.RegisterMqttRpcApi(System.String,System.Object)"/>
</member>
<member name="M:HslCommunication.MQTT.MqttServer.UnRegisterMqttRpcApi(System.String,System.Object)">
<summary>
卸载一个已经注册的RPC接口想要卸载指定的接口此处就需要传入注册时一样的参数<br />
Uninstall a registered RPC interface. If you want to uninstall the specified interface, you need to pass in the same parameters as the registration
</summary>
<param name="api">前置的接口信息可以理解为MVC模式的控制器</param>
<param name="obj">原始对象信息,也可以是类型对象本身</param>
</member>
<member name="M:HslCommunication.MQTT.MqttServer.UnRegisterMqttRpcApi(System.Object)">
<inheritdoc cref="M:HslCommunication.MQTT.MqttServer.UnRegisterMqttRpcApi(System.String,System.Object)"/>
</member>
<member name="M:HslCommunication.MQTT.MqttServer.UseFileServer(System.String)">
<summary>
启动文件服务功能协议头为FILE需要指定服务器存储的文件路径<br />
@ -33610,7 +33684,7 @@
<param name="mqttSession">当前的MQTT的会话内容</param>
<param name="clientId">客户端的id</param>
<param name="userName">用户名</param>
<param name="passwrod">密码</param>
<param name="password">密码</param>
<returns>0则是通过否则就是连接失败</returns>
</member>
<member name="E:HslCommunication.MQTT.MqttServer.ClientVerification">
@ -37140,6 +37214,34 @@
<item>本软件已经申请软件著作权软著登记号2020SR0340826任何盗用软件破解软件未经正式合同授权而商业使用均视为侵权。</item>
</list>
</revision>
<revision date="2024-10-30" version="12.1.2" author="Richard.Hu">
<list type="bullet">
<item>FujiSPBServer: DataFormat属性值修改为和客户端一致DEMO界面上可以调整该值修复英文界面下显示文本不正确的问题。</item>
<item>XinJEServer: 支持输入 DSD, HD 格式的地址针对客户端使用XinJE专用协议的时候有效如果用modbus协议的客户端则还是输入modbus的地址</item>
<item>SiemensS7Helper: 修复写入字符串的方法里判断字节长度超出PLC最大设置定值时字符串长度获取不正确的bug。</item>
<item>MqttClient: 新增加一个属性 Tag, 可以用来携带任意的自定义对象,方便客户端做一些个性化的处理。</item>
<item>Melsec: 三菱MC协议增加错误码17165的错误描述及解决办法解决办法是将用户认证功能设置为禁用。</item>
<item>LogNet: 日志类方法HslMessageFormat修改为虚方法重写这个方法即可以实现存储时自定义的格式DEMO界面在英文模式下显示英文显示按钮的代码。</item>
<item>MQTTServer: 新增方法UnRegisterMqttRpcApi用于卸载当前已经注册的指定接口方便用于动态控制接口此处的卸载是批量的。</item>
<item>HttpServer: 新增方法UnRegisterHttpRpcApi用于卸载当前已经注册的某些接口重复注册的时候将会覆盖旧的接口内容。</item>
<item>SimpleHybirdLock: 新增进入锁的时间,当获取锁对象字符串的时候,输出当前锁的状态以及占用锁的时间。</item>
<item>MqttServer: 修复ClientVerification事件签名里密码单词拼写不正确的bug。</item>
<item>OmronFinsServer: 欧姆龙的FINS虚拟服务器支持了客户端使用 E9 这种地址的数据读写操作不过所有的EM地址E地址都使用同一个数据块。</item>
<item>SecsServer: Secs服务器日志记录改为直接记录原始二进制的报文修复服务器创建中文字符串格式的SecsValue时长度显示不正确的bug。</item>
<item>DLT645Server: 修复当StationMatch属性为true时无论站号是否匹配都返回的bug现在只有站号一直才支持读写数据操作。</item>
<item>HslDeviceAddressAttribute: 新增字符串编码的属性当类型是字符串有效支持字符串数组修复长度为0时应用于西门子读取字符串时读取字符串不正确的bug。</item>
<item>Inovance: 汇川的PLC在AM系列下读取MB1005单数地址的字符串时也支持进行读取操作。</item>
<item>IModbus: 所有Modbus设备新增属性BroadcastStation设置0-255后使用该站号时将不检测返回的报文直接返回成功ModbusServer适配站号0不返回数据。</item>
<item>OmronFinsUdp: 属性SID信息不再进行自增操作将由用户手动设置然后demo界面支持手动设置操作。</item>
<item>Demo: 批量读取的界面新增是否字反转操作方便部分的PLC可以看到一些特殊的数据情况。</item>
<item>Demo: Secs服务器英文界面优化西门子Smart200测试界面增加随机写入测试并直接输出示例代码。</item>
<item>Demo: MQTT测试界面增加正则过滤功能。设备类的测试界面添加数据模拟的功能可以写入一些脚本实现的规律数据。</item>
<item>Demo: HttpClient测试界面的ContentType修改为可输入。Secs界面修复英文环境下标签名称不正确的问题</item>
<item>Demo: 设备测试界面的读取功能,支持勾选屏蔽重复的值,只有数据变化的时候,才在读取界面里显示,重复就显示重复次数,菜单调试下新增设置显示毫秒时间的功能。</item>
<item>新官网http://www.hsltechnology.cn/还有全新的使用文档的地址http://www.hsltechnology.cn/Doc/HslCommunication</item>
<item>本软件已经申请软件著作权软著登记号2020SR0340826任何盗用软件破解软件未经正式合同授权而商业使用均视为侵权。</item>
</list>
</revision>
</revisionHistory>
</member>
<member name="T:HslCommunication.Profinet.AllenBradley.AbStructHandle">
@ -42775,6 +42877,12 @@
<member name="M:HslCommunication.Profinet.Inovance.InovanceSerial.TranslateToModbusAddress(System.String,System.Byte)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceSerial.ReadString(System.String,System.UInt16,System.Text.Encoding)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceSerial.ReadStringAsync(System.String,System.UInt16,System.Text.Encoding)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceSerial.ToString">
<inheritdoc/>
</member>
@ -42821,6 +42929,12 @@
<member name="M:HslCommunication.Profinet.Inovance.InovanceSerialOverTcp.TranslateToModbusAddress(System.String,System.Byte)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceSerialOverTcp.ReadString(System.String,System.UInt16,System.Text.Encoding)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceSerialOverTcp.ReadStringAsync(System.String,System.UInt16,System.Text.Encoding)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceSerialOverTcp.ReadByte(System.String)">
<inheritdoc cref="M:HslCommunication.Profinet.Inovance.InovanceHelper.ReadByte(HslCommunication.ModBus.IModbus,System.String)"/>
</member>
@ -42899,6 +43013,12 @@
<member name="M:HslCommunication.Profinet.Inovance.InovanceTcpNet.TranslateToModbusAddress(System.String,System.Byte)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceTcpNet.ReadString(System.String,System.UInt16,System.Text.Encoding)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceTcpNet.ReadStringAsync(System.String,System.UInt16,System.Text.Encoding)">
<inheritdoc/>
</member>
<member name="M:HslCommunication.Profinet.Inovance.InovanceTcpNet.ToString">
<inheritdoc/>
</member>
@ -45301,9 +45421,6 @@
<param name="isBit">当前是否读写bool操作</param>
<returns>解析后的数据信息</returns>
</member>
<member name="P:HslCommunication.Profinet.Melsec.Helper.IReadWriteMc.ByteTransform">
<inheritdoc cref="P:HslCommunication.Core.Net.NetworkDoubleBase.ByteTransform"/>
</member>
<member name="P:HslCommunication.Profinet.Melsec.Helper.IReadWriteMc.McType">
<summary>
当前的MC协议的格式类型<br />
@ -60012,7 +60129,9 @@
<member name="T:HslCommunication.Secs.Types.SecsValue">
<summary>
SECS数据的对象信息可以用来表示层级及嵌套的数据内容如果需要显示只需要<see cref="M:HslCommunication.Secs.Types.SecsValue.ToString"/> 方法即可,
如果需要发送SECS设备只需要 <see cref="M:HslCommunication.Secs.Types.SecsValue.ToSourceBytes"/>,并支持反序列化操作 <see cref="M:HslCommunication.Secs.Types.SecsValue.ParseFromSource(System.Byte[],System.Text.Encoding)"/>无论是XML元素还是byte[]类型。
如果需要发送SECS设备只需要 <see cref="M:HslCommunication.Secs.Types.SecsValue.ToSourceBytes"/>,并支持反序列化操作 <see cref="M:HslCommunication.Secs.Types.SecsValue.ParseFromSource(System.Byte[],System.Text.Encoding)"/>无论是XML元素还是byte[]类型。<br />
SECS data object information, can be used to represent the hierarchy and nested data content, if you need to display, just need to <see cref="M:HslCommunication.Secs.Types.SecsValue.ToString"/> method can be.
If you need to send SECS equipment, only need <see cref="M:HslCommunication.Secs.Types.SecsValue.ToSourceBytes" />, and support the deserialization operation <see cref="M:HslCommunication.Secs.Types.SecsValue.ParseFromSource(System.Byte[],System.Text.Encoding)" />. Whether it's an XML element or byte[] type.
</summary>
<remarks>
XML序列化反序列化例子<br />
@ -60157,11 +60276,16 @@
<param name="value">数据值信息</param>
</member>
<member name="M:HslCommunication.Secs.Types.SecsValue.#ctor(HslCommunication.Secs.Types.SecsItemType,System.Object)">
<inheritdoc cref="M:HslCommunication.Secs.Types.SecsValue.#ctor(HslCommunication.Secs.Types.SecsItemType,System.Object,System.Int32)"/>
</member>
<member name="M:HslCommunication.Secs.Types.SecsValue.#ctor(HslCommunication.Secs.Types.SecsItemType,System.Object,System.Int32)">
<summary>
通过指定的参数信息来实例化一个对象
通过指定的参数类型及值信息,来实例化一个对象<br />
Instantiate an object by specifying the parameter type and value information
</summary>
<param name="type">数据的类型信息</param>
<param name="value">数据值信息,当是<see cref="F:HslCommunication.Secs.Types.SecsItemType.List"/>类型时,本值为空 </param>
<param name="length">长度参数信息</param>
</member>
<member name="M:HslCommunication.Secs.Types.SecsValue.#ctor(System.Xml.Linq.XElement)">
<summary>

Binary file not shown.

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tool
{
/// <summary>
/// 数据类型
/// </summary>
public enum DataTypeEnum
{
/// <summary>
/// 未定义
/// </summary>
[Description("未定义")]
None = 0,
/// <summary>
/// Bool
/// </summary>
[Description("Bool")]
Bool = 1,
/// <summary>
/// Byte
/// </summary>
[Description("Byte")]
Byte = 2,
/// <summary>
/// Int16
/// </summary>
[Description("Int16")]
Int16 = 3,
/// <summary>
/// UInt16
/// </summary>
[Description("UInt16")]
UInt16 = 4,
/// <summary>
/// Int32
/// </summary>
[Description("Int32")]
Int32 = 5,
/// <summary>
/// UInt32
/// </summary>
[Description("UInt32")]
UInt32 = 6,
/// <summary>
/// Int64
/// </summary>
[Description("Int64")]
Int64 = 7,
/// <summary>
/// UInt64
/// </summary>
[Description("UInt64")]
UInt64 = 8,
/// <summary>
/// Float
/// </summary>
[Description("Float")]
Float = 9,
/// <summary>
/// Double
/// </summary>
[Description("Double")]
Double = 10,
/// <summary>
/// String
/// </summary>
[Description("String")]
String = 11,
}
}

@ -1,4 +1,5 @@
using System;
using System.Management.Instrumentation;
using HslCommunication;
using HslCommunication.LogNet;
@ -10,6 +11,7 @@ namespace Tool
{
public class PlcConnect
{
private static ILogNet logNet = ILogNetFactory.GetLogNet;
private static readonly Lazy<AllenBradleyNet> lazy = new Lazy<AllenBradleyNet>(() => new PlcConnect().CreateAb());
public static AllenBradleyNet Instance => lazy.Value;
private PlcConnect()
@ -39,11 +41,70 @@ namespace Tool
public OperateResult Write(string db, string value)
{
return Instance.Write(db, value);
}
/// <summary>
/// 写入数据
/// </summary>
/// <param name="address">地址</param>
/// <param name="value">值</param>
/// <param name="type">数据类型</param>
/// <returns></returns>
public static OperateResult Write(string address, object value, DataTypeEnum type)
{
var result = new OperateResult() { IsSuccess = false };
switch (type)
{
case DataTypeEnum.Bool:
result= Instance.Write(address, Convert.ToBoolean(value));
break;
case DataTypeEnum.Byte:
result = Instance.Write(address, Convert.ToByte(value));
break;
case DataTypeEnum.Int16:
result = Instance.Write(address, Convert.ToInt16(value));
break;
case DataTypeEnum.UInt16:
result = Instance.Write(address, Convert.ToUInt16(value));
break;
case DataTypeEnum.Int32:
result = Instance.Write(address, Convert.ToInt32(value));
break;
case DataTypeEnum.UInt32:
result = Instance.Write(address, Convert.ToUInt32(value));
break;
case DataTypeEnum.Int64:
result = Instance.Write(address, Convert.ToInt64(value));
break;
case DataTypeEnum.UInt64:
result = Instance.Write(address, Convert.ToUInt64(value));
break;
case DataTypeEnum.Float:
result = Instance.Write(address, Convert.ToSingle(value));
break;
case DataTypeEnum.Double:
result = Instance.Write(address, Convert.ToDouble(value));
break;
}
logNet.WriteInfo("打印日志",$"write 地址[{address}] value:[{value.ToString()}] type:[{type.ToString()}] result:[{result.ToJsonString()}]");
return result;
}
}
}

@ -0,0 +1,194 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tool
{
/// <summary>
/// 请求结果
/// </summary>
public class Result
{
public Result()
{
}
/// <summary>
/// 是否成功
/// </summary>
public bool IsSucceed { get; set; } = true;
private string _Err;
/// <summary>
/// 异常消息
/// </summary>
public string Err
{
get
{
return _Err;
}
set
{
_Err = value;
AddErr2List();
}
}
/// <summary>
/// 异常Code
/// 408 连接失败
/// </summary>
public int ErrCode { get; set; }
/// <summary>
/// 详细异常
/// </summary>
public Exception Exception { get; set; }
/// <summary>
/// 异常集合
/// </summary>
public List<string> ErrList { get; private set; } = new List<string>();
/// <summary>
/// 请求报文
/// </summary>
public string Requst { get; set; }
/// <summary>
/// 响应报文
/// </summary>
public string Response { get; set; }
/// <summary>
/// 请求报文2
/// </summary>
public string Requst2 { get; set; }
/// <summary>
/// 响应报文2
/// </summary>
public string Response2 { get; set; }
/// <summary>
/// 耗时(毫秒)
/// </summary>
public double? TimeConsuming { get; private set; }
/// <summary>
/// 结束时间统计
/// </summary>
internal Result EndTime()
{
TimeConsuming = (DateTime.Now - InitialTime).TotalMilliseconds;
return this;
}
/// <summary>
/// 开始时间
/// </summary>
public DateTime InitialTime { get; protected set; } = DateTime.Now;
/// <summary>
/// 设置异常信息和Succeed状态
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public Result SetErrInfo(Result result)
{
IsSucceed = result.IsSucceed;
Err = result.Err;
ErrCode = result.ErrCode;
Exception = result.Exception;
foreach (var err in result.ErrList)
{
if (!ErrList.Contains(err))
ErrList.Add(err);
}
return this;
}
/// <summary>
/// 添加异常到异常集合
/// </summary>
public void AddErr2List()
{
if (!ErrList.Contains(Err))
ErrList.Add(Err);
}
}
/// <summary>
/// 请求结果
/// </summary>
public class Result<T> : Result
{
public Result()
{
}
public Result(T data)
{
Value = data;
}
public Result(Result result)
{
Assignment(result);
}
public Result(Result result, T data)
{
Assignment(result);
Value = data;
}
/// <summary>
/// 数据结果
/// </summary>
public T Value { get; set; }
/// <summary>
/// 结束时间统计
/// </summary>
internal new Result<T> EndTime()
{
base.EndTime();
return this;
}
/// <summary>
/// 赋值
/// </summary>
private void Assignment(Result result)
{
IsSucceed = result.IsSucceed;
InitialTime = result.InitialTime;
Err = result.Err;
Requst = result.Requst;
Response = result.Response;
Exception = result.Exception;
ErrCode = result.ErrCode;
base.EndTime();
foreach (var err in result.ErrList)
{
if (!ErrList.Contains(err))
ErrList.Add(err);
}
}
/// <summary>
/// 设置异常信息和Succeed状态
/// </summary>
/// <param name="result"></param>
/// <returns></returns>
public new Result<T> SetErrInfo(Result result)
{
base.SetErrInfo(result);
return this;
}
}
}

@ -62,9 +62,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataTypeEnum.cs" />
<Compile Include="HttpUtil.cs" />
<Compile Include="ILogNetFactory.cs" />
<Compile Include="PagedList.cs" />
<Compile Include="Result.cs" />
<Compile Include="RfidSetting.cs" />
<Compile Include="PlcConnect.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

Loading…
Cancel
Save