SiemensWebApiReadStringAsync 方法 (String, UInt16) |
从PLC中读取字符串内容,需要指定数据标签名称,使用JSON方式读取,所以无论字符串是中英文都是支持读取的。
To read the string content from the PLC, you need to specify the data tag name and use JSON to read it,
so no matter whether the string is in Chinese or English, it supports reading.
命名空间:
HslCommunication.Profinet.Siemens
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public override Task<OperateResult<string>> ReadStringAsync(
string address,
ushort length
)
Public Overrides Function ReadStringAsync (
address As String,
length As UShort
) As Task(Of OperateResult(Of String))
public:
virtual Task<OperateResult<String^>^>^ ReadStringAsync(
String^ address,
unsigned short length
) override
abstract ReadStringAsync :
address : string *
length : uint16 -> Task<OperateResult<string>>
override ReadStringAsync :
address : string *
length : uint16 -> Task<OperateResult<string>>
参数
- address
- 类型:SystemString
标签的地址信息,例如 "全局DB".Static_21 - length
- 类型:SystemUInt16
无效参数
返回值
类型:
TaskOperateResultString包含是否成功的结果对象
实现
IReadWriteNetReadStringAsync(String, UInt16)参见