From a36434956883df209ed62d9d5392812f34367768 Mon Sep 17 00:00:00 2001
From: czw <selecti@yeah.net>
Date: 星期四, 10 七月 2025 16:02:59 +0800
Subject: [PATCH] 1

---
 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs |   48 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 14 deletions(-)

diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
index d28c119..be67867 100644
--- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
+++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs"
@@ -477,7 +477,7 @@
             if (VERX != null)
             {
                 if (tag.wxr1.R46)
-                    LogHelper.Info($"{VERX.deviceName} R44>{tag.wxr1.R46} R44LAST>{tag.wxr1.R46_LAST} R10>{tag.wxr1.R11}");
+                    LogHelper.Info($"{VERX.deviceName} R46>{tag.wxr1.R46} R46LAST>{tag.wxr1.R46_LAST} R11>{tag.wxr1.R11}");
                 if (tag.wxr1.R46 && !tag.wxr1.R46_LAST && tag.wxr1.R11)
                 {
                     if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode) && !string.IsNullOrEmpty(traycode.Trim()))
@@ -642,7 +642,7 @@
             if (VERX != null)
             {
                 if (tag.wxr2.R46)
-                    LogHelper.Info($"{VERX.deviceName} R44>{tag.wxr2.R46} R44LAST>{tag.wxr2.R46_LAST} R10>{tag.wxr2.R11}");
+                    LogHelper.Info($"{VERX.deviceName} R46>{tag.wxr2.R46} R46LAST>{tag.wxr2.R46_LAST} R11>{tag.wxr2.R11}");
                 if (tag.wxr2.R46 && !tag.wxr2.R46_LAST && tag.wxr2.R11)
                 {
                     if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode) && !string.IsNullOrEmpty(traycode.Trim()))
@@ -664,7 +664,7 @@
                     }
                     else
                     {
-                        TcpServer.TcpServerSend(VERX.deviceNo[2], GZ.Device.PLC.PlcHelper.Hex2Bin("544F4E"));
+                        TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin("544F4E"));
                     }
                 }
                 else
@@ -1519,18 +1519,22 @@
                 //涓�嚎鍦板潃锛�0.221.55.181     绔彛锛�000
                 //if (IsMachineOnline("10.221.55.181"))
                 {
-                    //if (tag.DZ1.D2211 == 1 && tag.DZ1.D2220 == 1)
-                    //    tag.DZ1.D2211 = 0;
-                    //if (tag.DZ1.D2216 == 1 && tag.DZ1.D2225 == 1)
-                    //    tag.DZ1.D2216 = 0;
+                    if (tag.DZ1.D2211 == 1 && tag.DZ1.D2220 == 1)
+                        //tag.DZ1.D2211 = 0;
+                        Conn.榛樿Redis.SetValue("D瀹氬瓙1鍙锋満姊版墜.D2211", "0", "D瀹氬瓙1鍙锋満姊版墜Queue", false);
+                    if (tag.DZ1.D2216 == 1 && tag.DZ1.D2225 == 1)
+                        //tag.DZ1.D2216 = 0;
+                        Conn.榛樿Redis.SetValue("D瀹氬瓙1鍙锋満姊版墜.D2216", "0", "D瀹氬瓙1鍙锋満姊版墜Queue", false);
                 }
                 //浜岀嚎鍦板潃锛�0.221.55.179     绔彛锛�000
                 //if (IsMachineOnline("10.221.55.179"))
                 {
-                    //if (tag.DZ2.D2211 == 1 && tag.DZ2.D2220 == 1)
-                    //    tag.DZ2.D2211 = 0;
-                    //if (tag.DZ2.D2216 == 1 && tag.DZ2.D2225 == 1)
-                    //    tag.DZ2.D2216 = 0;
+                    if (tag.DZ2.D2211 == 1 && tag.DZ2.D2220 == 1)
+                        //tag.DZ2.D2211 = 0;
+                        Conn.榛樿Redis.SetValue("D瀹氬瓙2鍙锋満姊版墜.D2211", "0", "D瀹氬瓙2鍙锋満姊版墜Queue", false);
+                    if (tag.DZ2.D2216 == 1 && tag.DZ2.D2225 == 1)
+                        //tag.DZ2.D2216 = 0;
+                        Conn.榛樿Redis.SetValue("D瀹氬瓙2鍙锋満姊版墜.D2216", "0", "D瀹氬瓙2鍙锋満姊版墜Queue", false);
                 }
             }
             LogHelper.Info($"ThreadGrats deviceType5鍏夋爡鍐欏叆浣嶉噸缃畬鎴愩� =================> ");
@@ -2172,7 +2176,19 @@
         }
         public void Thread1030Down(Tag tag)
         {
-            //Console.WriteLine($"SA1030 浠诲姟鐘舵�锛�  =====>agv瀹屾垚SOver{tag.SA1030.SOver}");
+            Console.WriteLine($"SA1030 浠诲姟鐘舵�锛�  =====>");
+            if (tag.SA1030.RtaskState == 4 && tag.SA1030.RtaskState_LAST == 0 && tag.SA2001.R5绌洪棽 == 1)
+            {
+                var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + "mom-basic/dataTransmission/json/service/200", JsonConvert.SerializeObject(new
+                {
+                    requestType = 10,
+                    startBit = "1030",
+                    endBit = "2001",
+                }));
+                RedisHelper.Add($"S1030Read.RtaskState_LAST", "1", out string msg);
+            }
+            else if (tag.SA1030.RtaskState != 4 && tag.SA1030.RtaskState_LAST == 1)
+                RedisHelper.Add($"S1030Read.RtaskState_LAST", "0", out string msg);
             //if (tag.SA1019.SOver && tag.SA1019.SreadSsxOver)
             //{
             //    SetRedistoPlc("A1022鏀捐揣浜や簰.Ssetreq", "false", "A1022鏀捐揣浜や簰Queue", "娓呯悊");
@@ -2703,7 +2719,7 @@
 
         public string procNo()
         {
-            return TaskProcess.GenerateTaskNo("鏃ュ織娴佹按鍙�);
+            return TaskProcess.GenerateTaskNo("鏃ュ織娴佹按鍙�, "LOG");
         }
         public bool SetRedistoPlc(string key, string value, string queue, string desc)
         {
@@ -3050,6 +3066,7 @@
                 {
                     requestType = 7,
                     startBit = VERX.location[0],
+                    endBit = "1025",
                     unLockStartBitOutbin = true
                 }));
                 LogHelper.Info($"{VERX.location[0]}鐢宠mes浠诲姟缁撴灉{str}");
@@ -3073,6 +3090,7 @@
                 {
                     requestType = 7,
                     startBit = VERX.location[1],
+                    endBit = "1025",
                     unLockStartBitOutbin = true
                 }));
                 LogHelper.Info($"{VERX.location[0]}鐢宠mes浠诲姟缁撴灉{str}");
@@ -3102,13 +3120,14 @@
                 LogHelper.Info("瀹氬瓙2鍙风嚎 deviceType 5 娌℃湁閰嶇疆銆�);
                 return;
             }
-            LogHelper.Info($" {VERX.deviceName} D2221>{tag.DZ1.D2221} D2221_LAST>{tag.DZ1.D2221_LAST}  D2226>{tag.DZ1.D2226}  D2226_LAST>{tag.DZ1.D2226_LAST}");
+            LogHelper.Info($" {VERX.deviceName} D2221>{tag.DZ2.D2221} D2221_LAST>{tag.DZ2.D2221_LAST}  D2226>{tag.DZ2.D2226}  D2226_LAST>{tag.DZ2.D2226_LAST}");
             if (tag.DZ2.D2221 == 1 && tag.DZ2.D2221_LAST == 0)
             {
                 var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + "mom-basic/dataTransmission/json/service/200", JsonConvert.SerializeObject(new
                 {
                     requestType = 7,
                     startBit = VERX.location[0],
+                    endBit = "1025",
                     unLockStartBitOutbin = true
                 }));
                 LogHelper.Info($"{VERX.location[0]}鐢宠mes浠诲姟缁撴灉{str}");
@@ -3131,6 +3150,7 @@
                 {
                     requestType = 7,
                     startBit = VERX.location[1],
+                    endBit = "1025",
                     unLockStartBitOutbin = true
                 }));
                 LogHelper.Info($"{VERX.location[0]}鐢宠mes浠诲姟缁撴灉{str}");

--
Gitblit v1.9.1