lss
2025-05-27 59f836bf0eb00b7707c74fe8edb8fa7662c871ab
HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs
@@ -160,11 +160,17 @@
        /// </summary>
        internal static void DpjTraffic()
        {
            string startBti = "CMB17-DP-001";
            var devices = Settings.deviceInfos.Where(a => a.deviceType == 1).ToList();
            //var db = new SqlHelper<object>().GetInstance();
            //var list = db.Queryable<Location>().Where(a => a.N_CURRENT_NUM > 0  && a.N_LOCK_STATE == 0).OrderByDescending(a => a.N_COL).Take(1).PartitionBy(a => a.N_ROW).ToList();
            try
            {
                var IsDp = S7Helper.ReadDpj(2001, S7.Net.VarType.Byte);
                var value = S7Helper.ReadDpj(2014, S7.Net.VarType.Int);
                if (devices.Count > 0)
                {
                    foreach (var device in devices)
                    {
                        var IsDp = S7Helper.ReadDpj(device.address,2001, S7.Net.VarType.Byte);
                        var value = S7Helper.ReadDpj(device.address,2014, S7.Net.VarType.Int);
                if (value >= 1 && IsDp == 1)
                {
@@ -176,10 +182,10 @@
                    //}
                    //创建过未完成的任务不发起请求
                    var mst = WCSHelper.GetTaskByStartloc(startBti);
                            var mst = WCSHelper.GetTaskByStartloc(device.TN_Location);
                    if (mst == null)
                    {
                        Traystacker(startBti, value, 2);
                                Traystacker(device.TN_Location, value, 2);
                    }
                    else
                    {
@@ -193,6 +199,9 @@
                }
                Thread.Sleep(8000);
            }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error($"ReadDpj DpjTraffic:{ex}", ex);