点击或拖拽改变大小

ModbusTcpNetWriteMaskAsync 方法

向设备写入掩码数据,使用0x16功能码,需要确认对方是否支持相关的操作,掩码数据的操作主要针对寄存器。
To write mask data to the server, using the 0x16 function code, you need to confirm whether the other party supports related operations. The operation of mask data is mainly directed to the register.

命名空间:  HslCommunication.ModBus
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public Task<OperateResult> WriteMaskAsync(
	string address,
	ushort andMask,
	ushort orMask
)

参数

address
类型:SystemString
起始地址,起始地址,比如"100","x=4;100","s=1;100","s=1;x=4;100"
andMask
类型:SystemUInt16
等待与操作的掩码数据
orMask
类型:SystemUInt16
等待或操作的掩码数据

返回值

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