1
czw
9 天以前 a36434956883df209ed62d9d5392812f34367768
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/´úÂë/VS×Ô¶¨ÒåÀà/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 @@
                //一线地址:10.221.55.181     ç«¯å£ï¼š6000
                //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);
                }
                //二线地址:10.221.55.179     ç«¯å£ï¼š6000
                //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}");