diff --git a/.vs/HighWayIot/FileContentIndex/0aeb8ea8-e984-4282-ba81-2b9a6206fe23.vsidx b/.vs/HighWayIot/FileContentIndex/0aeb8ea8-e984-4282-ba81-2b9a6206fe23.vsidx new file mode 100644 index 00000000..aa41ecc0 Binary files /dev/null and b/.vs/HighWayIot/FileContentIndex/0aeb8ea8-e984-4282-ba81-2b9a6206fe23.vsidx differ diff --git a/.vs/HighWayIot/FileContentIndex/40f19310-04eb-448e-b832-5aa0364abd39.vsidx b/.vs/HighWayIot/FileContentIndex/40f19310-04eb-448e-b832-5aa0364abd39.vsidx deleted file mode 100644 index 68ad685b..00000000 Binary files a/.vs/HighWayIot/FileContentIndex/40f19310-04eb-448e-b832-5aa0364abd39.vsidx and /dev/null differ diff --git a/.vs/HighWayIot/FileContentIndex/75488deb-b8a0-4b6d-a2fd-9897844a8a00.vsidx b/.vs/HighWayIot/FileContentIndex/75488deb-b8a0-4b6d-a2fd-9897844a8a00.vsidx deleted file mode 100644 index cb5e496f..00000000 Binary files a/.vs/HighWayIot/FileContentIndex/75488deb-b8a0-4b6d-a2fd-9897844a8a00.vsidx and /dev/null differ diff --git a/.vs/HighWayIot/FileContentIndex/890d36a3-c193-4179-9302-10a4b1ea1e87.vsidx b/.vs/HighWayIot/FileContentIndex/890d36a3-c193-4179-9302-10a4b1ea1e87.vsidx new file mode 100644 index 00000000..06ae2fc9 Binary files /dev/null and b/.vs/HighWayIot/FileContentIndex/890d36a3-c193-4179-9302-10a4b1ea1e87.vsidx differ diff --git a/.vs/HighWayIot/FileContentIndex/418bae13-df2b-437a-8c1b-b025311227e4.vsidx b/.vs/HighWayIot/FileContentIndex/ebf823f5-8490-40d9-8696-ab31227d1a2c.vsidx similarity index 66% rename from .vs/HighWayIot/FileContentIndex/418bae13-df2b-437a-8c1b-b025311227e4.vsidx rename to .vs/HighWayIot/FileContentIndex/ebf823f5-8490-40d9-8696-ab31227d1a2c.vsidx index b84d8b97..0c86fe95 100644 Binary files a/.vs/HighWayIot/FileContentIndex/418bae13-df2b-437a-8c1b-b025311227e4.vsidx and b/.vs/HighWayIot/FileContentIndex/ebf823f5-8490-40d9-8696-ab31227d1a2c.vsidx differ diff --git a/.vs/HighWayIot/v17/.suo b/.vs/HighWayIot/v17/.suo index 6b1d57f3..1ff4df6d 100644 Binary files a/.vs/HighWayIot/v17/.suo and b/.vs/HighWayIot/v17/.suo differ diff --git a/Aucma.Scada.Business/InStoreBusiness.cs b/Aucma.Scada.Business/InStoreBusiness.cs index c0e0fdc7..e2797878 100644 --- a/Aucma.Scada.Business/InStoreBusiness.cs +++ b/Aucma.Scada.Business/InStoreBusiness.cs @@ -121,20 +121,20 @@ namespace Aucma.Scada.Business StartPassDown(); - //Task.Run(() => - //{ - // Thread.Sleep(3000); - // for (int i = 1; i < 2; i++) - // { - // // 8302501181 8302500586 9 - // InStore("B2401018302500586001" + i); - // Thread.Sleep(1000); - // } - - // InStore("B2401018302501181001" + 1); - // Thread.Sleep(1000); - // InStore("B2401018302500889001" + 1); - // }); + Task.Run(() => + { + Thread.Sleep(3000); + for (int i = 1; i < 2; i++) + { + // 8302501181 8302500586 9 + InStore("B2401018302500586001" + i); + Thread.Sleep(1000); + } + + InStore("B2401018302501181001" + 1); + Thread.Sleep(1000); + InStore("B2401018302500889001" + 1); + }); } #region delete 2024-01-04出库时堵塞入库 ,不需要堵塞整个库 diff --git a/Aucma.Scada.Business/InStoreTaskHandle.cs b/Aucma.Scada.Business/InStoreTaskHandle.cs index 34133d0c..b3b63159 100644 --- a/Aucma.Scada.Business/InStoreTaskHandle.cs +++ b/Aucma.Scada.Business/InStoreTaskHandle.cs @@ -270,8 +270,7 @@ namespace Aucma.Scada.Business if (_plc != null) { - if (_plc.IsConnected) - { + // 测试方法,模拟plc,正式启用删除 // _plc.writeInt32ByAddress(plcConfig.in_foam_answer, 1); if (_plc.readInt32ByAddress(plcConfig.in_foam_answer) == 1) @@ -295,11 +294,7 @@ namespace Aucma.Scada.Business logHelper.Info("应答字为2,下发新任务plc未就绪"); } - } - else - { - logHelper.Info($"仓库{taskInfo.storeCode};PLC未连接"); - } + } else { @@ -329,8 +324,7 @@ namespace Aucma.Scada.Business { if (_plc != null) { - if (_plc.IsConnected) - { + do { // 测试方法,模拟plc,正式启用删除 @@ -351,11 +345,7 @@ namespace Aucma.Scada.Business Thread.Sleep(500); } while (isFlag); - } - else - { - logHelper.Info($"仓库{appConfig.foamStoreCode};PLC未连接"); - } + } else { diff --git a/Aucma.Scada.Business/OutStoreBusiness.cs b/Aucma.Scada.Business/OutStoreBusiness.cs index dba650a8..c2f77873 100644 --- a/Aucma.Scada.Business/OutStoreBusiness.cs +++ b/Aucma.Scada.Business/OutStoreBusiness.cs @@ -407,6 +407,8 @@ namespace Aucma.Scada.Business { PrintLogInfoMessage("出库应答成功,自动释放信号量,进行下发新任务"); semaphore.Release(); + // 视为出库完成,后续改为监测在库数 + OutStoreFinish(storeCode, taskCode); } /// diff --git a/Aucma.Scada.Business/OutStoreTaskHandle.cs b/Aucma.Scada.Business/OutStoreTaskHandle.cs index 329d0487..fe35a50e 100644 --- a/Aucma.Scada.Business/OutStoreTaskHandle.cs +++ b/Aucma.Scada.Business/OutStoreTaskHandle.cs @@ -81,7 +81,7 @@ namespace Aucma.Scada.Business { _plcDictionary = _pool.GetAll(); _taskInfoService = registerServices.GetService(); - RealReadFinish(); + // RealReadFinish(); } @@ -102,7 +102,7 @@ namespace Aucma.Scada.Business if (_plcDictionary.Count > 0) { IPlc _plc = _plcDictionary[appConfig.foamStoreCode]; - if (_plc != null && _plc.IsConnected) + if (_plc != null) { //出库完成 if (_plc.readInt32ByAddress(plcConfig.out_foam_finish) == 1) @@ -160,8 +160,7 @@ namespace Aucma.Scada.Business if (_plc != null) { - if (_plc.IsConnected) - { + if (_plc.readInt32ByAddress(plcConfig.out_foam_answer) == 1) { logHelper.Info("泡后出库应答字为1,货道号:" + plcConfig.out_foam_spaceCode + ";写" + short.Parse(taskInfo.spaceCode.Substring(5, 1))); @@ -180,11 +179,7 @@ namespace Aucma.Scada.Business result = 2; logHelper.Info("应答字为2,下发新任务plc未就绪"); } - } - else - { - logHelper.Info($"仓库{taskInfo.storeCode};PLC未连接"); - } + } else { @@ -214,17 +209,19 @@ namespace Aucma.Scada.Business { if (_plc != null) { - if (_plc.IsConnected) - { + do { //读取PLC应答字为2时,上位机清空写入的出库内容 if (_plc.readInt32ByAddress(plcConfig.out_foam_answer) == 2) { - - logHelper.Info("出库应答字为2,货道号:" + plcConfig.out_foam_spaceCode + ";复位写0"); + + + logHelper.Info("出库应答字写3,应答字为2,货道号:" + plcConfig.out_foam_spaceCode + ";复位写0"); //写入货道号 _plc.writeInt32ByAddress(plcConfig.out_foam_spaceCode, 0); + //写入应答字3 + _plc.writeInt32ByAddress(plcConfig.out_foam_answer, 3); //写入出库数量 _plc.writeInt32ByAddress(plcConfig.out_foam_amount, 0); isFlag = false; @@ -234,11 +231,7 @@ namespace Aucma.Scada.Business Thread.Sleep(500); } while (isFlag); - } - else - { - logHelper.Info($"仓库{appConfig.foamStoreCode};PLC未连接"); - } + } else { @@ -268,12 +261,11 @@ namespace Aucma.Scada.Business if (_plc != null) { - if (_plc.IsConnected) - { + spaceInfo.spaceStock = _plc.readInt32ByAddress(spaceAddress.onStore); spaceInfo.onRouteAmount = _plc.readInt32ByAddress(spaceAddress.onRoute); // spaceInfo.spaceStatus = _plc.readInt32ByAddress(spaceAddress.spaceStatus); - } + } return spaceInfo; diff --git a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll index 0dfbd025..7c923d9e 100644 Binary files a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll and b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.dll differ diff --git a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb index a351dcac..b385f384 100644 Binary files a/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb and b/Aucma.Scada.Business/bin/Debug/Aucma.Scada.Business.pdb differ diff --git a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.dll index 0dfbd025..7c923d9e 100644 Binary files a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.dll and b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.dll differ diff --git a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.pdb b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.pdb index a351dcac..b385f384 100644 Binary files a/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.pdb and b/Aucma.Scada.Business/obj/Debug/Aucma.Scada.Business.pdb differ diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll index 0dfbd025..7c923d9e 100644 Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.dll differ diff --git a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb index a351dcac..b385f384 100644 Binary files a/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb and b/Aucma.Scada.UI/bin/Debug/Aucma.Scada.Business.pdb differ diff --git a/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache index beafb573..d4722b0e 100644 Binary files a/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache and b/Aucma.Scada.UI/obj/Debug/Aucma.Scada.UI.csproj.AssemblyReference.cache differ