ModbusInfo 类 |
命名空间: HslCommunication.ModBus
ModbusInfo 类型公开以下成员。
名称 | 说明 | |
---|---|---|
ModbusInfo | 初始化 ModbusInfo 类的一个新实例 |
名称 | 说明 | |
---|---|---|
AnalysisAddress |
分析Modbus协议的地址信息,该地址适应于tcp及rtu模式 Analysis of the address information of Modbus protocol, the address is adapted to tcp and rtu mode | |
BuildReadModbusCommand(ModbusAddress, Int32) |
构建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, Int32, 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, IByteTransform) |
构建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, IByteTransform) |
构建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, IByteTransform) |
构建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, IByteTransform) |
构建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 | Determines whether the specified object is equal to the current object. (继承自 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 | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) | |
GetDescriptionByErrorCode |
通过错误码来获取到对应的文本消息 Get the corresponding text message through the error code | |
GetHashCode | Serves as the default hash function. (继承自 Object。) | |
GetType | Gets the Type of the current instance. (继承自 Object。) | |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 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 | Returns a string that represents the current object. (继承自 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 |
名称 | 说明 | |
---|---|---|
FunctionCodeNotSupport |
不支持该功能码
| |
FunctionCodeOverBound |
该地址越界
| |
FunctionCodeQuantityOver |
读取长度超过最大值
| |
FunctionCodeReadWriteException |
读写异常
| |
ReadCoil |
读取线圈
| |
ReadDiscrete |
读取离散量
| |
ReadInputRegister |
读取输入寄存器
| |
ReadRegister |
读取寄存器
| |
ReadWrite |
读写同时的功能码,只有极个别的设备可能会支持的功能码
| |
WriteCoil |
写多个线圈
| |
WriteMaskRegister |
使用掩码的方式写入寄存器
| |
WriteOneCoil |
写单个线圈
| |
WriteOneRegister |
写单个寄存器
| |
WriteRegister |
写多个寄存器
|
名称 | 说明 | |
---|---|---|
ToJsonString |
获取当前对象的JSON格式表示的字符串。 (由 HslExtension 定义。)Gets the string represented by the JSON format of the current object. |