点击或拖拽改变大小

ModbusInfo 类

Modbus协议相关的一些信息,包括功能码定义,报文的生成的定义等等信息
Some information related to Modbus protocol, including function code definition, definition of message generation, etc.
继承层次
SystemObject
  HslCommunication.ModBusModbusInfo

命名空间:  HslCommunication.ModBus
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.0.0.0 (12.0.0.0)
语法
public class ModbusInfo

ModbusInfo 类型公开以下成员。

构造函数
  名称说明
公共方法ModbusInfo
初始化 ModbusInfo 类的一个新实例
Top
方法
  名称说明
公共方法静态成员AnalysisAddress
分析Modbus协议的地址信息,该地址适应于tcp及rtu模式
Analysis of the address information of Modbus protocol, the address is adapted to tcp and rtu mode
公共方法静态成员BuildReadModbusCommand(ModbusAddress, UInt16)
构建Modbus读取数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码应该根据bool或是字来区分
To construct the core message of Modbus reading data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code should be distinguished according to bool or word
公共方法静态成员BuildReadModbusCommand(String, UInt16, Byte, Boolean, Byte)
构建Modbus读取数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码应该根据bool或是字来区分
To construct the core message of Modbus reading data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code should be distinguished according to bool or word
公共方法静态成员BuildReadWriteModbusCommand
构建一个同时读写的命令报文,指定读取地址,读取长度,写入地址,写入的字节数据信息,然后整个命令返回读取成功的字节数据信息
公共方法静态成员BuildWriteBoolModbusCommand(ModbusAddress, Boolean)
构建Modbus写入bool数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message that Modbus writes to bool data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteBoolModbusCommand(ModbusAddress, Boolean)
构建Modbus写入bool数组的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message that Modbus writes to the bool array, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteBoolModbusCommand(String, Boolean, Byte, Boolean, Byte)
构建Modbus写入bool数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message that Modbus writes to bool data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteBoolModbusCommand(String, Boolean, Byte, Boolean, Byte)
构建Modbus写入bool数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message that Modbus writes to bool data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteMaskModbusCommand(ModbusAddress, UInt16, UInt16)
构建Modbus写入掩码数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message of Modbus writing mask data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteMaskModbusCommand(String, UInt16, UInt16, Byte, Boolean, Byte)
构建Modbus写入掩码的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the Modbus write mask core message, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteOneRegisterModbusCommand(ModbusAddress, Int16)
构建Modbus写入字数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message of Modbus writing word data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteOneRegisterModbusCommand(ModbusAddress, UInt16)
构建Modbus写入字数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message of Modbus writing word data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteWordModbusCommand(ModbusAddress, Byte)
构建Modbus写入字数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message of Modbus writing word data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteWordModbusCommand(String, Byte, Byte, Boolean, Byte)
构建Modbus写入字数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message of Modbus writing word data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteWordModbusCommand(String, Int16, Byte, Boolean, Byte)
构建Modbus写入字数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message of Modbus writing word data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员BuildWriteWordModbusCommand(String, UInt16, Byte, Boolean, Byte)
构建Modbus写入字数据的核心报文,需要指定地址,长度,站号,是否起始地址0,默认的功能码
To construct the core message of Modbus writing word data, you need to specify the address, length, station number, whether the starting address is 0, and the default function code
公共方法静态成员CheckAsciiReceiveDataComplete(Byte)
当消息头报文的长度定义为-1的时候,则使用动态的长度信息,可以使用本方法来判断一个消息是否处于完整的状态。
If the length of the message header is defined as -1, this method can be used to determine whether a message is in the complete state by using dynamic length information.
公共方法静态成员CheckAsciiReceiveDataComplete(Byte, Int32)
当消息头报文的长度定义为-1的时候,则使用动态的长度信息,可以使用本方法来判断一个消息是否处于完整的状态。
If the length of the message header is defined as -1, this method can be used to determine whether a message is in the complete state by using dynamic length information.
公共方法静态成员CheckRtuMessageMatch
检查当前发送和接收的modbusrtu报文是否站号匹配,匹配返回 1,此处进行匹配的时候,还有一定的容错范围
公共方法静态成员CheckRtuReceiveDataComplete
当消息头报文的长度定义为-1的时候,则使用动态的长度信息,可以使用本方法来判断一个消息是否处于完整的状态。
If the length of the message header is defined as -1, this method can be used to determine whether a message is in the complete state by using dynamic length information.
公共方法静态成员CheckServerRtuReceiveDataComplete
当消息头报文的长度定义为-1的时候,则使用动态的长度信息,可以使用本方法来判断一个消息是否处于完整的状态。
If the length of the message header is defined as -1, this method can be used to determine whether a message is in the complete state by using dynamic length information.
公共方法Equals (继承自 Object。)
公共方法静态成员ExplodeRtuCommandToCore
将modbus-rtu的数据重新还原成modbus数据,移除CRC校验的内容
Restore the data of modbus-rtu to modbus data again, remove the content of CRC check
公共方法静态成员ExplodeTcpCommandToCore
将modbus-tcp的报文数据重新还原成modbus指令,移除6个字节的报文头数据
Re-modify the message data of modbus-tcp into the modbus command, remove the 6-byte message header data
公共方法静态成员ExtractActualData
从返回的modbus的书内容中,提取出真实的数据,适用于写入和读取操作
Extract real data from the content of the returned modbus book, suitable for writing and reading operations
受保护的方法Finalize (继承自 Object。)
公共方法静态成员GetDescriptionByErrorCode
通过错误码来获取到对应的文本消息
Get the corresponding text message through the error code
公共方法GetHashCode (继承自 Object。)
公共方法GetType (继承自 Object。)
受保护的方法MemberwiseClone (继承自 Object。)
公共方法静态成员PackCommandToRtu
将modbus指令打包成Modbus-Rtu指令,在报文的末尾添加CRC16的校验码
Pack the modbus instruction into Modbus-Rtu instruction, add CRC16 check code at the end of the message
公共方法静态成员PackCommandToTcp
将modbus指令打包成Modbus-Tcp指令,需要指定ID信息来添加6个字节的报文头
Pack the Modbus command into Modbus-Tcp command, you need to specify the ID information to add a 6-byte message header
公共方法ToString (继承自 Object。)
公共方法静态成员TransAsciiPackCommandToCore
将一个modbus-ascii的数据报文,转换成的modbus核心数据报文,移除首尾标记,移除LRC校验
Convert a Modbus-ascii data message into a Modbus core data message, remove the first and last tags, and remove the LRC check
公共方法静态成员TransModbusCoreToAsciiPackCommand
将一个modbus核心的数据报文,转换成modbus-ascii的数据报文,增加LRC校验,增加首尾标记数据
Convert a Modbus core data message into a Modbus-ascii data message, add LRC check, and add head and tail tag data
Top
字段
  名称说明
公共字段静态成员FunctionCodeNotSupport
不支持该功能码
公共字段静态成员FunctionCodeOverBound
该地址越界
公共字段静态成员FunctionCodeQuantityOver
读取长度超过最大值
公共字段静态成员FunctionCodeReadWriteException
读写异常
公共字段静态成员ReadCoil
读取线圈
公共字段静态成员ReadDiscrete
读取离散量
公共字段静态成员ReadInputRegister
读取输入寄存器
公共字段静态成员ReadRegister
读取寄存器
公共字段静态成员ReadWrite
读写同时的功能码,只有极个别的设备可能会支持的功能码
公共字段静态成员WriteCoil
写多个线圈
公共字段静态成员WriteMaskRegister
使用掩码的方式写入寄存器
公共字段静态成员WriteOneCoil
写单个线圈
公共字段静态成员WriteOneRegister
写单个寄存器
公共字段静态成员WriteRegister
写多个寄存器
Top
扩展方法
  名称说明
公共扩展器方法ToJsonString
获取当前对象的JSON格式表示的字符串。
Gets the string represented by the JSON format of the current object.
(由 HslExtension 定义。)
Top
参见