向设备写入掩码数据,使用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 中) 版本:12.1.2.0 (12.1.2.0)
语法 public OperateResult WriteMask(
string address,
ushort andMask,
ushort orMask
)
Public Function WriteMask (
address As String,
andMask As UShort,
orMask As UShort
) As OperateResult
public:
OperateResult^ WriteMask(
String^ address,
unsigned short andMask,
unsigned short orMask
)
member WriteMask :
address : string *
andMask : uint16 *
orMask : uint16 -> OperateResult
参数
- address
- 类型:SystemString
起始地址,起始地址,比如"100","x=4;100","s=1;100","s=1;x=4;100" - andMask
- 类型:SystemUInt16
等待与操作的掩码数据 - orMask
- 类型:SystemUInt16
等待或操作的掩码数据
返回值
类型:
OperateResult是否写入成功
参见