From 517dc7b733a1e161f743a23ef5cd24589d297946 Mon Sep 17 00:00:00 2001 From: HCL <1625932291@qq.com> Date: Mon, 6 May 2024 14:20:40 +0800 Subject: [PATCH] =?UTF-8?q?1.Custom=20Message=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MECF/Framework/Common/Gem/GemManager.cs | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/MECF.Framework.Common/MECF/Framework/Common/Gem/GemManager.cs b/MECF.Framework.Common/MECF/Framework/Common/Gem/GemManager.cs index 08a5472..f2cb733 100644 --- a/MECF.Framework.Common/MECF/Framework/Common/Gem/GemManager.cs +++ b/MECF.Framework.Common/MECF/Framework/Common/Gem/GemManager.cs @@ -161,7 +161,7 @@ namespace MECF.Framework.Common.Gem _equipment.EventTriggered += EventTriggered; - //register custom SECS message S7F7 message handler + //register custom SECS message _equipment.RegisterMessageHandler(7, 7, HandleS7F7); //Variable value change callback @@ -229,8 +229,8 @@ namespace MECF.Framework.Common.Gem //无异常 var s7f8 = new ReplyMessage(message); var l = new SecsList(); - //l.AddChild(new SecsU4(0)); - //l.AddChild(new SecsBoolean(true)); + l.AddChild(new SecsU4(0)); + l.AddChild(new SecsBoolean(true)); s7f8.Body = l; _equipment?.SendMessage(_equipment.MasterConnectionName, s7f8); } @@ -272,28 +272,28 @@ namespace MECF.Framework.Common.Gem //} } - //private void HandleS7F65(DataMessage message) - //{ - // //实现对S7F65的解析处理 - // var listNode = (SecsList)message.Body; - // var ppID = listNode[0].GetValueAsString(); - // var pmID = listNode[1].GetValueAsString(); - // //TODO: perform the command - // var s7f66 = new ReplyMessage(message); - // s7f66.Body = new SecsBinary(0); - // _equipment.SendMessage(_equipment.MasterConnectionName, s7f66); - //} + private void HandleS7F65(DataMessage message) + { + //实现对S7F65的解析处理 + var listNode = (SecsList)message.Body; + var ppID = listNode[0].GetValueAsString(); + var pmID = listNode[1].GetValueAsString(); + //TODO: perform the command + var s7f66 = new ReplyMessage(message); + s7f66.Body = new SecsBinary(0); + _equipment.SendMessage(_equipment.MasterConnectionName, s7f66); + } - //private void SendCustomMessage() - //{ - // var s99f1 = new DataMessage(99, 1, true); - // var list1 = new SecsList(); - // list1.AddChild(new SecsAscii("SMIFReady")); - // list1.AddChild(new SecsList()); - // s99f1.Body = list1; + private void SendCustomMessage() + { + var s99f1 = new DataMessage(99, 1, true); + var list1 = new SecsList(); + list1.AddChild(new SecsAscii("SMIFReady")); + list1.AddChild(new SecsList()); + s99f1.Body = list1; - // _equipment.SendMessage(_equipment.MasterConnectionName, s99f1); - //} + _equipment.SendMessage(_equipment.MasterConnectionName, s99f1); + } private bool Monitor() {