BeckhoffAdsNetReadAsync 方法 (String, UInt16) |
批量读取PLC的数据,需要传入地址数组,以及读取的长度数组信息,长度单位为字节单位,如果是读取bool变量的,则以bool为单位,统一返回一串字节数据信息,需要进行二次解析的操作。
To read PLC data in batches, you need to pass in the address array and the read length array information. The unit of length is in bytes. If you read a bool variable,
it will return a string of byte data information in units of bool. , which requires a secondary parsing operation.
命名空间:
HslCommunication.Profinet.Beckhoff
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public Task<OperateResult<byte[]>> ReadAsync(
string[] address,
ushort[] length
)
Public Function ReadAsync (
address As String(),
length As UShort()
) As Task(Of OperateResult(Of Byte()))
public:
Task<OperateResult<array<unsigned char>^>^>^ ReadAsync(
array<String^>^ address,
array<unsigned short>^ length
)
member ReadAsync :
address : string[] *
length : uint16[] -> Task<OperateResult<byte[]>>
参数
- address
- 类型:SystemString
地址数组信息 - length
- 类型:SystemUInt16
读取的长度数组信息
返回值
类型:
TaskOperateResultByte原始字节数组的结果对象
备注
关于二次解析的参考信息,可以参考API文档,地址:http://api.hslcommunication.cn
For reference information about secondary parsing, you can refer to the API documentation, address: http://api.hslcommunication.cn
参见