111
cjs
2025-06-10 f4302a3078545c8e3e2075bdfd4b01804dc79a5b
ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs
@@ -4478,6 +4478,96 @@
            CMMLog.Info($"在通道{plc.writeAddr + 2}中写入{JsonConvert.SerializeObject(num)},ip:{plc.ip},端口:{plc.port}");
        }
        /// <summary>
        /// 四钴A(洗板烘干机组)设备上空下满
        /// </summary>
        /// <param name="plc"></param>
        /// <exception cref="NotImplementedException"></exception>
        internal static void AMachine(Settings.PlcInfo plc)
        {
            if (PickUpStartFree(plc.location) && PickUpEndFree(plc.location))
            {
                try
                {
                    var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel
                    {
                        dataNum = 1,
                        addr = plc.readAddr,
                        host = plc.ip,
                        port = plc.port
                    });
                    if (result != null && result.errCode == 0)
                    {
                        if (result.result[0] == 1)
                        {
                            //送空
                            bool req = WMSHelper.WMSOut(plc.location, "", "");
                            if (req) CMMLog.Debug($"四钴A设备 调用WMS获取空托出库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型)
                            else CMMLog.Debug($"四钴A设备 调用WMS获取空托出库生成任务失败!");
                        }
                        if (result.result[0] == 2)
                        {
                            //取满
                            string wmstaskno = "";
                            string traycode = "";
                            bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode);
                            if (req) CMMLog.Debug($"四钴A设备 调用WMS获取满托入库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型)
                            else CMMLog.Debug($"四钴A设备 调用WMS获取满托入库生成任务失败!");
                        }
                    }
                }
                catch (Exception ex)
                {
                    CMMLog.Info($"四钴A设备 err:{ex.Message}");
                }
            }
        }
        /// <summary>
        /// 四钴C(钴板剪切机组)设备上满下空
        /// </summary>
        /// <param name="a"></param>
        /// <exception cref="NotImplementedException"></exception>
        internal static void CMachine(Settings.PlcInfo plc)
        {
            if (PickUpStartFree(plc.location) && PickUpEndFree(plc.location))
            {
                try
                {
                    var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel
                    {
                        dataNum = 1,
                        addr = plc.readAddr,
                        host = plc.ip,
                        port = plc.port
                    });
                    if (result != null && result.errCode == 0)
                    {
                        if (result.result[0] == 1)
                        {
                            //送满
                            bool req = WMSHelper.WMSOut(plc.location, "", "");
                            if (req) CMMLog.Debug($"四钴C设备 调用WMS获取满托出库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型)
                            else CMMLog.Debug($"四钴C设备 调用WMS获取满托出库生成任务失败!");
                        }
                        if (result.result[0] == 2)
                        {
                            //取空
                            string wmstaskno = "";
                            string traycode = "";
                            bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode);
                            if (req) CMMLog.Debug($"四钴C设备 调用WMS获取空托入库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型)
                            else CMMLog.Debug($"四钴C设备 调用WMS获取空托入库生成任务失败!");
                        }
                    }
                }
                catch (Exception ex)
                {
                    CMMLog.Info($"四钴C设备 err:{ex.Message}");
                }
            }
        }
        #endregion
        public class WMS_STOCK_VIEW