点击或拖拽改变大小

AllenBradleyNetWriteAsync 方法 (String, Byte)

写入Byte数据,返回是否写入成功,默认使用类型 0xC2, 如果PLC的变量类型不一样,则需要指定实际的变量类型,例如PLC的变量 A 是0xD1类型,那么地址需要携带类型信息,type=0xD1;A
Write Byte data and return whether the writing is successful. The default type is 0xC2. If the variable types of the PLC are different, you need to specify the actual variable type. For example, the variable A of the PLC is of type 0xD1, then the address needs to carry the type information, type= 0xD1;A

命名空间:  HslCommunication.Profinet.AllenBradley
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public virtual Task<OperateResult> WriteAsync(
	string address,
	byte value
)

参数

address
类型:SystemString
标签的地址数据
value
类型:SystemByte
Byte数据

返回值

类型:TaskOperateResult
是否写入成功
备注
如何确认PLC的变量的类型呢?可以在HslCommunicationDemo程序上测试知道,也可以直接调用 ReadWithType(String, UInt16) 来知道类型信息。
参见