点击或拖拽改变大小

ModbusTcpNetReadWriteAsync 方法

使用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.0.0.0 (12.0.0.0)
语法
public Task<OperateResult<byte[]>> ReadWriteAsync(
	string readAddress,
	ushort length,
	string writeAddress,
	byte[] value
)

参数

readAddress
类型:SystemString
读取的地址信息
length
类型:SystemUInt16
读取的长度信息
writeAddress
类型:SystemString
写入的地址信息
value
类型:SystemByte
写入的字节数据信息

返回值

类型:TaskOperateResultByte
读取的结果对象
参见