使用0x17功能码来实现同时写入并读取数据的操作,使用一条报文来实现,需要指定读取的地址,长度,写入的地址,写入的数据信息,返回读取的结果数据。
Use 0x17 function code to write and read data at the same time, and use a message to implement it,
you need to specify the read address, length, written address, written data information, and return the read result data.
命名空间:
HslCommunication.ModBus
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 OperateResult<byte[]> ReadWrite(
string readAddress,
ushort length,
string writeAddress,
byte[] value
)
Function ReadWrite (
readAddress As String,
length As UShort,
writeAddress As String,
value As Byte()
) As OperateResult(Of Byte())
OperateResult<array<unsigned char>^>^ ReadWrite(
String^ readAddress,
unsigned short length,
String^ writeAddress,
array<unsigned char>^ value
)
abstract ReadWrite :
readAddress : string *
length : uint16 *
writeAddress : string *
value : byte[] -> OperateResult<byte[]>
参数
- readAddress
- 类型:SystemString
读取的地址信息 - length
- 类型:SystemUInt16
读取的长度信息 - writeAddress
- 类型:SystemString
写入的地址信息 - value
- 类型:SystemByte
写入的字节数据信息
返回值
类型:
OperateResultByte读取的结果对象
参见