MemobusHelperWrite 方法 (IMemobus, String, UInt16, FuncString, UInt16, OperateResult) |
命名空间: HslCommunication.Profinet.YASKAWA.Helper
public static OperateResult Write( IMemobus memobus, string address, ushort value, Func<string, ushort, OperateResult> writeUShort )
[缺少 "M:HslCommunication.Profinet.YASKAWA.Helper.MemobusHelper.Write(HslCommunication.Profinet.YASKAWA.Helper.IMemobus,System.String,System.UInt16,System.Func{System.String,System.UInt16,HslCommunication.OperateResult})" 的 <param name="memobus"/> 文档]
[缺少 "M:HslCommunication.Profinet.YASKAWA.Helper.MemobusHelper.Write(HslCommunication.Profinet.YASKAWA.Helper.IMemobus,System.String,System.UInt16,System.Func{System.String,System.UInt16,HslCommunication.OperateResult})" 的 <param name="writeUShort"/> 文档]
MelsecMcNet melsec_net = new MelsecMcNet( "192.168.0.100", 6000 ); // 简单的写入 melsec_net.Write( "D100", (ushort)123 ); // 如果想要判断是否写入成功 OperateResult write = melsec_net.Write( "D100", (ushort)123 ); if (write.IsSuccess) { // success } else { // failed }