From 3b4ab19a4b05e098e971746c692a0d012fde7445 Mon Sep 17 00:00:00 2001 From: liudl <673013083@qq.com> Date: 星期五, 26 九月 2025 17:49:12 +0800 Subject: [PATCH] 修改问题 --- Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 104 insertions(+), 0 deletions(-) diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs index c194339..b27be3b 100644 --- a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs +++ b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs @@ -551,6 +551,11 @@ Thread.Sleep(1000); modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "50.2", "false"); break; + case "applyTask": + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "50.1", "true"); + Thread.Sleep(1000); + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "50.1", "false"); + break; default: break; @@ -582,6 +587,70 @@ if (modPlc == null) throw Oops.Bah($"鏈煡璇㈠埌1妤煎眰PLC淇℃伅"); DbNum = "DB91"; + PLCUtil modUtil = new PLCUtil(modPlc); + switch (input.Type) + { + case "OnePalletStart": + if (input.FuncName == "true") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "true"); + } + else if (input.FuncName == "false") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "false"); + } + else + { + throw Oops.Bah("浜嬩欢缁撴灉閿欒"); + } + break; + case "OnePalletStop": + if (input.FuncName == "true") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "true"); + } + else if (input.FuncName == "false") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "false"); + } + else + { + throw Oops.Bah("浜嬩欢缁撴灉閿欒"); + } + break; + case "OneBoxStart": + if (input.FuncName == "true") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.2", "true"); + } + else if (input.FuncName == "false") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.2", "false"); + } + else + { + throw Oops.Bah("浜嬩欢缁撴灉閿欒"); + } + break; + case "OneBoxStop": + + if (input.FuncName == "true") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.3", "true"); + } + else if (input.FuncName == "false") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.3", "false"); + } + else + { + throw Oops.Bah("浜嬩欢缁撴灉閿欒"); + } + break; + default: + break; + } + modUtil.Close(); } else if (input.Layer == "2") { @@ -716,6 +785,41 @@ if (modPlc == null) throw Oops.Bah($"鏈煡璇㈠埌3妤煎眰PLC淇℃伅"); DbNum = "DB91"; + PLCUtil modUtil = new PLCUtil(modPlc); + switch (input.Type) + { + case "ThreePalletStart": + if (input.FuncName == "true") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "true"); + } + else if (input.FuncName == "false") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.0", "false"); + } + else + { + throw Oops.Bah("浜嬩欢缁撴灉閿欒"); + } + break; + case "ThreePalletStop": + if (input.FuncName == "true") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "true"); + } + else if (input.FuncName == "false") + { + modUtil.SetPlcDBValue(PLCDataTypeEnum.Bit, DbNum, "46.1", "false"); + } + else + { + throw Oops.Bah("浜嬩欢缁撴灉閿欒"); + } + break; + default: + break; + } + modUtil.Close(); } else { -- Gitblit v1.8.0