From 295251bf072d48e9cdf7e3819eb0817708bbd842 Mon Sep 17 00:00:00 2001 From: tangxu <76880903@qq.com> Date: 星期三, 26 十月 2022 09:43:15 +0800 Subject: [PATCH] 添加 关机 开机 指令(南通) --- Socket/IStation.DataDockingSocket4NT/helper/MsgDataHelper.cs | 87 +++++++++++++++++++++++++------------------ 1 files changed, 51 insertions(+), 36 deletions(-) diff --git a/Socket/IStation.DataDockingSocket4NT/helper/MsgDataHelper.cs b/Socket/IStation.DataDockingSocket4NT/helper/MsgDataHelper.cs index 06bdf4c..b2abd2a 100644 --- a/Socket/IStation.DataDockingSocket4NT/helper/MsgDataHelper.cs +++ b/Socket/IStation.DataDockingSocket4NT/helper/MsgDataHelper.cs @@ -71,16 +71,7 @@ } - /// <summary> - /// 鑾峰彇鎺у埗鎸囦护(鍏虫満) - /// </summary> - /// <returns></returns> - public static byte[] GetControlMsg鍏虫満() - { - return null; - - } - + /// <summary> /// /// </summary> @@ -95,31 +86,6 @@ } return appParas.InstructionQuerys; } - /// <summary> - /// 鑾峰彇鎺у埗鎸囦护(寮�鏈�) - /// </summary> - /// <returns></returns> - public static byte[] GetControlMsg寮�鏈�() - { - return null; - } - - - /// <summary> - /// 鑾峰彇鎺у埗鎸囦护(璋冮) - /// </summary> - /// <returns></returns> - public static byte[] GetControlMsg璋冮(double frequece) - { - var iFrequece = (int)(frequece * 10); - - byte[] commandSend = null; - - IStation.DataDockingSocket.ModBusRtuHelper.BuildSendMessage06(0x01, 20, 2, iFrequece, ref commandSend); - - return commandSend; - } - /// <summary> /// 鑾峰彇鏌ヨ鎸囦护(鐩戞帶鍊�) @@ -127,6 +93,7 @@ /// <returns></returns> public byte[] GetMonitorMsg鐩戞帶鍊�() { + return new byte[] { 0x01, 0x03, 0x00, 0x19, 0x00, 0x19, 0x55, 0xC7 }; } @@ -140,6 +107,54 @@ { return new byte[] { 0x01, 0x03, 0x00, 0x12, 0x00, 0x04, 0xE4, 0x0C }; } + + /// <summary> + /// 鑾峰彇鎺у埗鎸囦护(寮�鏈�) + /// </summary> + /// <returns></returns> + public static byte[] GetControlMsg寮�鏈�() + { + var appParas = GetAppParas(); + if (appParas == null || appParas.InstructionStartUp == null || appParas.InstructionStartUp.Content == null) + { + return BitTransfer.FromString("01-06-00-0F-00-01-78-09"); + } + return BitTransfer.FromString(appParas.InstructionStartUp.Content); + } + + /// <summary> + /// 鑾峰彇鎺у埗鎸囦护(鍏虫満) + /// </summary> + /// <returns></returns> + public static byte[] GetControlMsg鍏虫満() + { + var appParas = GetAppParas(); + if (appParas == null || appParas.InstructionStartUp == null || appParas.InstructionStartUp.Content == null) + { + return BitTransfer.FromString("01-06-00-10-00-01-49-CF"); + } + return BitTransfer.FromString(appParas.InstructionShutDown.Content); + } + + + /// <summary> + /// 鑾峰彇鎺у埗鎸囦护(璋冮) + /// </summary> + /// <returns></returns> + public static byte[] GetControlMsg璋冮(double frequece) + { + var iFrequece = (int)(frequece * 10); + + byte[] commandSend = null; + + IStation.DataDockingSocket.ModBusRtuHelper.BuildSendMessage06(0x01, 20, 2, + iFrequece, ref commandSend); + + return commandSend; + } + + + /// <summary> @@ -456,7 +471,7 @@ } - #region MyRegion + #region 鏁版嵁杞寲 private static int GetInt2Byte(byte[] byteMessage, int startPosition, out string info) { byte[] value = new byte[2]; -- Gitblit v1.9.3