MemobusHelperWriteAsync 方法 (IMemobus, String, UInt16, FuncString, UInt16, TaskOperateResult) |
命名空间: HslCommunication.Profinet.YASKAWA.Helper
public static Task<OperateResult> WriteAsync( IMemobus memobus, string address, ushort value, Func<string, ushort, Task<OperateResult>> writeUShort )
[缺少 "M:HslCommunication.Profinet.YASKAWA.Helper.MemobusHelper.WriteAsync(HslCommunication.Profinet.YASKAWA.Helper.IMemobus,System.String,System.UInt16,System.Func{System.String,System.UInt16,System.Threading.Tasks.Task{HslCommunication.OperateResult}})" 的 <param name="memobus"/> 文档]
[缺少 "M:HslCommunication.Profinet.YASKAWA.Helper.MemobusHelper.WriteAsync(HslCommunication.Profinet.YASKAWA.Helper.IMemobus,System.String,System.UInt16,System.Func{System.String,System.UInt16,System.Threading.Tasks.Task{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 }