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.1.2.0 (12.1.2.0)
语法 public Task<OperateResult<byte[]>> ReadWriteAsync(
string readAddress,
ushort length,
string writeAddress,
byte[] value
)
Public Function ReadWriteAsync (
readAddress As String,
length As UShort,
writeAddress As String,
value As Byte()
) As Task(Of OperateResult(Of Byte()))
public:
Task<OperateResult<array<unsigned char>^>^>^ ReadWriteAsync(
String^ readAddress,
unsigned short length,
String^ writeAddress,
array<unsigned char>^ value
)
member ReadWriteAsync :
readAddress : string *
length : uint16 *
writeAddress : string *
value : byte[] -> Task<OperateResult<byte[]>>
参数
- readAddress
- 类型:SystemString
读取的地址信息 - length
- 类型:SystemUInt16
读取的长度信息 - writeAddress
- 类型:SystemString
写入的地址信息 - value
- 类型:SystemByte
写入的字节数据信息
返回值
类型:
TaskOperateResultByte读取的结果对象
参见