111
cjs
2025-06-11 67f54fd5f720263e8a2937b0f0b0a610141bef08
ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs
@@ -183,7 +183,6 @@
                                                if (trayCode.errCode == 0 && trayCode.result.Length == 95)
                                                {
                                                    //获取托盘码等信息  读取通道 11、12、13的数据作为托盘码   读取其它通道 重量 叠包等信息 所有数据存入MachineInfo表
                                                    string flLoc = "";
                                                    string location = "";
                                                    GetMachineData(pmInfo,ref location, trayCode.result, false, "1");
@@ -731,7 +730,7 @@
        internal static void PickUpFullDoorComplete(string ip, string taskNo)
        {
            var plc = Settings.GetPlcInfo().Where(a => a.ip == ip).FirstOrDefault();
            if (plc != null)
            if (plc != null && !plc.location.Contains("FLZT"))
            {
                //写入包装机--安全门关门指令
                var writeRes = OITcpHelper.RegisterWriteOutPut(new OITcpHelper.RegisterWriteOutPutModel
@@ -4478,6 +4477,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