点击或拖拽改变大小

McHelperWriteRandomAsync 方法

随机字写入数据到PLC里,可以跨地址写入,指定一个字符串数组,一个地址需要对应2个字节,所以写入的字节长度为地址两倍。
Randomly write data into the PLC. It can be written across addresses. Specify a string array. One address needs to correspond to 2 bytes, so the length of the written bytes is twice the address.

命名空间:  HslCommunication.Profinet.Melsec.Helper
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.9.1.0 (12.9.1.0)
语法
public static Task<OperateResult> WriteRandomAsync(
	IReadWriteMc mc,
	string[] address,
	byte[] data
)

参数

mc
类型:HslCommunication.Profinet.Melsec.HelperIReadWriteMc
MC协议通信对象
address
类型:SystemString
所有的地址集合
data
类型:SystemByte
写入数据

返回值

类型:TaskOperateResult
是否写入成功
参见