McBinaryHelperReadBoolTagAsync 方法 |
[商业授权] 读取PLC的标签信息,需要传入标签的名称,读取的字长度,标签举例:A; label[1]; bbb[10,10,10]
[Authorization] To read the label information of the PLC, you need to pass in the name of the label,
the length of the word read, and an example of the label: A; label [1]; bbb [10,10,10]
命名空间:
HslCommunication.Profinet.Melsec.Helper
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.3.0.0 (12.3.0.0)
语法public static Task<OperateResult<bool[]>> ReadBoolTagAsync(
IReadWriteMc mc,
string tag,
ushort length
)
Public Shared Function ReadBoolTagAsync (
mc As IReadWriteMc,
tag As String,
length As UShort
) As Task(Of OperateResult(Of Boolean()))
public:
static Task<OperateResult<array<bool>^>^>^ ReadBoolTagAsync(
IReadWriteMc^ mc,
String^ tag,
unsigned short length
)
static member ReadBoolTagAsync :
mc : IReadWriteMc *
tag : string *
length : uint16 -> Task<OperateResult<bool[]>>
参数
- mc
- 类型:HslCommunication.Profinet.Melsec.HelperIReadWriteMc
MC协议通信对象 - tag
- 类型:SystemString
[缺少 "M:HslCommunication.Profinet.Melsec.Helper.McBinaryHelper.ReadBoolTagAsync(HslCommunication.Profinet.Melsec.Helper.IReadWriteMc,System.String,System.UInt16)" 的 <param name="tag"/> 文档]
- length
- 类型:SystemUInt16
读取长度
返回值
类型:
TaskOperateResultBoolean是否成功
备注
不可以访问局部标签。
不可以访问通过GX Works2设置的全局标签。
为了访问全局标签,需要通过GX Works3的全局标签设置编辑器将“来自于外部设备的访问”的设置项目置为有效。(默认为无效。)
以ASCII代码进行数据通信时,由于需要从UTF-16将标签名转换为ASCII代码,因此报文容量将增加
参见