BoxBean_Partial.cs 26.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
using Asa;
using DeviceLib;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace OnlineStore.DeviceLibrary
{
    partial class BoxBean
    {
        public ConcurrentQueue<InOutParam> waitOutStoreList = new ConcurrentQueue<InOutParam>();
        public InOutParam waitInStoreParam = null;

        #region 出入库结果验证  
        private bool AcInPosition(ConfigMoveAxis axis, int p)
        {
            return ACServerManager.isInPosition(axis.DeviceName, axis.GetAxisValue(), p, axis.CanErrorCountMax);

        }
        private static DateTime lastComRHomeTime = DateTime.Now;
        private void InOutBackToP1(int InOut_P1)
        {
            //判断是否在P1,如果是,不需要运行  
            if (AcInPosition(Config.InOut_Axis, InOut_P1))
            {
                LogUtil.debug(Name + "进出轴当前已经在P1,不需要再回P1");
            }
            else
            {
                InoutAxis.AbsMove(MoveInfo, InOut_P1, Config.InOutAxis_P1_Speed);
            }
        }


        /// <summary>
        ///是否已经接收到过出库信息
        ///</summary> 
        public bool IsReviceInPosId(string posId)
        {
            bool isReviceInfo = false;
            try
            {
                if (MoveInfo.MoveType.Equals(MoveType.InStore) && MoveInfo.MoveParam != null && MoveInfo.MoveParam.PosID.Equals(posId))
                {
                    LogInfo(" IsReviceInPosId 正在入库中:" + MoveInfo.MoveParam.ToStr());
                    isReviceInfo = true;
                }
                if (!isReviceInfo && (waitInStoreParam != null))
                {
                    if (waitInStoreParam.PosID.Equals(posId) && (!waitInStoreParam.WareCode.Equals("")))
                    {
                        LogInfo(" IsReviceInPosId 已存在入库任务:" + waitInStoreParam.ToStr());
                        isReviceInfo = true;
                    }
                }
            }
            catch (Exception ex)
            {
                LogUtil.error("IsReviceInPosId【" + posId + "】出错:" + ex.ToString());
            }
            return isReviceInfo;
        }
        #endregion

        #region 入库

        private DateTime startInStoreTime = DateTime.Now;

        public override bool StartInStoreMove(InOutParam param)
        {
            startInStoreTime = DateTime.Now;
            string posId = param != null ? param.PosID : "";
            if (isInSuddenDown || isNoAirCheck ||
           (!runStatus.Equals(StoreRunStatus.Runing))
           || (!MoveInfo.MoveType.Equals(MoveType.None)))
            {
                LogUtil.error(Name + " 启动出库出错,忙碌或报警中 ,storeStatus=" + runStatus + ",MoveType=" + MoveInfo.MoveType + ",isInSuddenDown=" + isInSuddenDown + ",isNoAirCheck" + isNoAirCheck);
                return false;
            }

            if (!StoreManager.LoadInoutParam(param, MoveType.InStore, true, this))
            {
                LogUtil.error(Name + " 启动入库【" + param.ToStr() + "】出错,找不到库位信息");
                return false;
            }
            LogInfo(" 启动入库【" + param.ToStr() + "】 ");
            runStatus = StoreRunStatus.Busy;
            if (param.TargetPosition.Equals(0))
            {
                storeStatus = StoreStatus.InStoreExecute;
            }
            param.moveType = MoveType.InStore;
            MoveInfo.NewMove(MoveType.InStore, param);

            //新的料架库位
            MoveInfo.NextMoveStep(StoreMoveStep.SI_01_InoutToP1);
            InOutStoreLog("启动入料: 进出轴返回P1");
            InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P1, Config.InOutAxis_P1_Speed);
            return true;
        }

        protected override void InStoreProcess()
        {
            string outType = "入库:";
            if (MoveInfo.MoveParam.TargetPosition.Equals(1))
            {
                outType = "NG料:";
            }
            LineMoveP moveP = MoveInfo.MoveParam.MoveP;
            if (MoveInfo.IsInWait)
            {
                CheckWait();
            }
            if (MoveInfo.IsInWait)
            {
                return;
            }
            if (MoveInfo.IsStep(StoreMoveStep.SI_01_InoutToP1))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_02_AxisBack);
                InOutStoreLog(outType + "   升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P3["+ moveP.ComPress_P3 + "]");
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
                MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_02_AxisBack))
            {
                if (StoreManager.Store.BoxDoorFree(ID))
                {
                    MoveInfo.NextMoveStep(StoreMoveStep.SI_03_InoutToP2);
                    InOutStoreLog(outType + "进出轴到P2[" + moveP.InOut_P2 + "] ");
                    InoutAxis.AbsMove(MoveInfo, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
                    ClearTimeoutAlarm("进出轴可以到P2");
                }
                else if (MoveInfo.IsTimeOut(60))
                {
                    WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 进出轴可以到P2 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
                    LogUtil.error(WarnMsg, ID * 1000 + 30);
                    Alarm(AlarmType.IoSingleTimeOut);
                }
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_03_InoutToP2))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_04_GetReel);
                InOutStoreLog(outType + "升降轴到入料口高点P2 ["+ moveP.UpDown_P2 + "],压紧轴到P2 ["+ moveP.ComPress_P2 + "] ");
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P2, Config.CompAxis_P2_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed );
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_04_GetReel))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_05_InoutToP1);
                InOutStoreLog(outType + "进出轴返回P1 [" + moveP.InOut_P1 + "] ");
                InOutBackToP1(moveP.InOut_P1);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_05_InoutToP1))
            {
                if (MoveInfo.MoveParam.TargetPosition.Equals(0))
                {
                    MoveInfo.NextMoveStep(StoreMoveStep.SI_06_ToPos);
                    InOutStoreLog(outType + "移动到库位点,旋转轴到P2["+ moveP.Middle_P2 + "],升降轴到P3 ["+ moveP.UpDown_P3 + "] ");
                    MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
                    UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
                }
                else
                {
                    MoveInfo.NextMoveStep(StoreMoveStep.SI_21_ToOutDoor);
                    InOutStoreLog(outType + "移动到出料口,旋转轴到P11["+ Config.MiddleAxis_P11 + "],升降轴到P12高点["+ Config.UpDownAxis_P12 + "] ");
                    MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P11, Config.MiddleAxis_P11_Speed);
                    UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P12, Config.UpDownAxis_P12_Speed);
                }
            }

            #region 正常入库处理

            else if (MoveInfo.IsStep(StoreMoveStep.SI_06_ToPos))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_07_InoutToP3);
                InOutStoreLog(outType + "进出轴到P3 ["+ moveP.InOut_P3 + "]  ");
                InoutAxis.AbsMove(MoveInfo, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_07_InoutToP3))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_08_PutReel);
                InOutStoreLog(outType + "升降轴到P4["+ moveP.UpDown_P4 + "],压紧轴到P3["+ moveP.ComPress_P3 + "]");

                // 5= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)   
                string posId = MoveInfo.MoveParam.PosID;
                lastPosId = posId;
                lastPosIdStatus = StoreStatus.InStoreEnd;
                storeStatus = StoreStatus.InStoreEnd;
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P4, Config.UpDownAxis_P4_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_08_PutReel))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_09_InoutToP1);
                InOutStoreLog(outType + "进出轴返回P1 [" + moveP.InOut_P1 + "] ");
                InOutBackToP1(moveP.InOut_P1);
                OutDoorReelType = 2;
            }
            else if (MoveInfo.IsStep( StoreMoveStep.SI_09_InoutToP1))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_10_GoBack);
                InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "],");
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
                MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_10_GoBack))
            {
                TimeSpan span = DateTime.Now - startInStoreTime;
                string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
                LogUtil.info(Name + "  【" + posId + "】入库结束,耗时【" + FormUtil.GetSpanStr(span) + "】");
                MoveEndP();
                AutoInout.InOutEndProcess(this, MoveType.InStore);
            }


            #endregion

            #region NG料到出口

            else if (MoveInfo.IsStep(StoreMoveStep.SI_21_ToOutDoor))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_22_OpenOutDoor);
                InOutStoreLog(outType + "打开出料口门  ");
                CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_22_OpenOutDoor))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_23_InoutToP11);
                InOutStoreLog(outType + "进出轴到_P11-出料口取放料点 ["+ Config.InOutAxis_P11 + "] ");
                InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P11, Config.InOutAxis_P11_Speed);
                //关闭舱门  
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_23_InoutToP11))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_24_PurReel);
                InOutStoreLog(outType + "升降轴到_P11-出料口-低点["+ Config.UpDownAxis_P11 + "],压紧轴到压紧前点P3["+ moveP.ComPress_P3 + "] ");

                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
                UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P11, Config.UpDownAxis_P11_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_24_PurReel))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_25_InoutToP1);
                InOutStoreLog(outType + "进出轴返回P1 ["+ moveP.InOut_P1 + "] ");
                InOutBackToP1(moveP.InOut_P1);
                OutDoorReelType = 1;
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_25_InoutToP1))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SI_26_GoBack);
                InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "],关闭出料口门");
                CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
                MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SI_26_GoBack))
            {
                TimeSpan span = DateTime.Now - startInStoreTime;
                string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
                LogUtil.info(Name + "  【" + posId + "】NG料送料结束,耗时【" + FormUtil.GetSpanStr(span) + "】");
                MoveEndP();
            }


            #endregion
            else
            {
                LogUtil.error(Name + " 入库,MoveInfo.MoveStep=" + MoveInfo.MoveStep + ",没有对应的处理!");
            }
        }

        #endregion

        #region 出库
        private DateTime startOutStoreTime = DateTime.Now;
        private void StartExecuctOut(InOutParam param)
        {
            bool result = false;
            if (StoreManager.Store.CanOut(true))
            {
                result = StartOutStoreMove(param);
            }

            if (!result)
            {
                LogInfo(" 执行出库【" + param.ToStr() + "】失败,加入等待队列");
                waitOutStoreList.Enqueue(param);
            }
        }

        public override bool StartOutStoreMove(InOutParam param)
        {
            startOutStoreTime = DateTime.Now;
            string posId = param != null ? param.PosID : "";

            if (isInSuddenDown || isNoAirCheck ||
            (!runStatus.Equals(StoreRunStatus.Runing))
            || (!MoveInfo.MoveType.Equals(MoveType.None)))
            {
                LogUtil.error(Name + " 启动出库【" + param.ToStr() + "】失败,忙碌或报警中 ,storeStatus:" + runStatus + ",MoveType:" + MoveInfo.MoveType + ",isInSuddenDown:" + isInSuddenDown + ",isNoAirCheck:" + isNoAirCheck);
                return false;
            }

            if (!StoreManager.LoadInoutParam(param, MoveType.OutStore, false, this))
            {
                LogUtil.error(Name + " 启动出库【" + param.ToStr() + "】出错,找不到库位信息");
                return false;
            }
            param.TargetBox = ID;
            storeStatus = StoreStatus.OutStoreExecute;
            runStatus = StoreRunStatus.Busy;
            param.moveType = MoveType.OutStore;
            MoveInfo.NewMove(MoveType.OutStore, param);
            LogInfo("启动出库【" + param.ToStr() + "】  ");
            //出库前shelfPosID需要固定,出库时根据rfid判断是否需要出入料架
            MoveInfo.NextMoveStep(StoreMoveStep.SO_01_InoutBack);
            InOutStoreLog("出库 :进出轴到P1  开始");
            InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
            return true;
        }

        protected override void OutStoreProcess()
        {
            string outType = "出库:";
            if (MoveInfo.MoveParam.TargetPosition.Equals(1))
            {
                outType = "单盘出库:";
            }
            LineMoveP moveP = MoveInfo.MoveParam.MoveP;
            if (MoveInfo.IsInWait)
            {
                CheckWait();
            }
            if (MoveInfo.IsInWait)
            {
                return;
            }
            if (MoveInfo.IsStep(StoreMoveStep.SO_01_InoutBack))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_02_ToPosition);
                InOutStoreLog(outType + "压紧轴到压紧前点P3[" + moveP.ComPress_P3 + "] ,旋转轴到库位点P2[" + moveP.Middle_P2 + "],升降轴到P5 [" + moveP.UpDown_P5 + "] ");
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
                MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_02_ToPosition))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_03_InoutToP3);
                InOutStoreLog(outType + " 进出轴至P3 [" + moveP.InOut_P3 + "] ");
                InoutAxis.AbsMove(MoveInfo, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_03_InoutToP3))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_04_GetReel);
                InOutStoreLog(outType + "升降轴到P6[" + moveP.UpDown_P6 + "],压紧轴到P2[" + moveP.ComPress_P2 + "]");
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P2, Config.CompAxis_P2_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P6, Config.UpDownAxis_P6_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_04_GetReel))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_05_InoutBack);
                InOutStoreLog(outType + "进出轴返回P1[" + moveP.InOut_P1 + "]");
                InOutBackToP1(moveP.InOut_P1);
                //把库位的物品放到取到叉子上之后是出仓完成 
                string posId = MoveInfo.MoveParam.PosID;
                lastPosId = posId;
                lastPosIdStatus = StoreStatus.OutStoreBoxEnd;
                storeStatus = StoreStatus.OutStoreBoxEnd;

            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_05_InoutBack))
            {
                if (MoveInfo.MoveParam.TargetPosition.Equals(0))
                {
                    MoveInfo.NextMoveStep(StoreMoveStep.SO_06_ToDoor);
                    InOutStoreLog(outType + "旋转轴 至P1[" + moveP.Middle_P1 + "],升降轴到P2[" + moveP.UpDown_P2 + "] ");
                    MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1 , Config.MiddleAxis_P1_Speed);
                    UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P2, Config.UpDownAxis_P1_Speed);
                }
                else
                {
                    MoveInfo.NextMoveStep(StoreMoveStep.SO_21_ToOutDoor);
                    InOutStoreLog(outType + "移动到出料口,旋转轴到P11[" + Config.MiddleAxis_P11 + "],升降轴到P12高点[" + Config.UpDownAxis_P12 + "] ");
                    MiddleAxis.AbsMove(MoveInfo, Config.MiddleAxis_P11, Config.MiddleAxis_P11_Speed);
                    UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P12, Config.UpDownAxis_P12_Speed);
                }
            }
            #region 批量出料,到料串

            else if (MoveInfo.IsStep(StoreMoveStep.SO_06_ToDoor))
            {
                if (StoreManager.Store.BoxDoorFree(ID))
                {
                    MoveInfo.NextMoveStep(StoreMoveStep.SO_07_InoutToP2);
                    InOutStoreLog(outType + "进出轴到P2 [" + moveP.InOut_P2 + "]");
                    InoutAxis.AbsMove(MoveInfo, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
                    ClearTimeoutAlarm("进出轴可以到P2");
                }
                else if (MoveInfo.IsTimeOut(60))
                {
                    WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 进出轴可以到P2 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
                    LogUtil.error(WarnMsg, ID * 1000 + 30);
                    Alarm(AlarmType.IoSingleTimeOut);
                }
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_07_InoutToP2))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_08_PutReel);
                InOutStoreLog(outType + "放下物品 升降轴至P1[" + moveP.UpDown_P1 + "],压紧轴到P3 [" + moveP.ComPress_P3 + "]");
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P2_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_08_PutReel))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_09_InoutBack);
                InOutStoreLog(outType + "进出轴返回P1[" + moveP.InOut_P1 + "]");
                InOutBackToP1(moveP.InOut_P1);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_09_InoutBack))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_10_GoBack);
                InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "] ,压紧轴到P1[" + moveP.ComPress_P1 + "] ");
                MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
                MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
            }

            else if (MoveInfo.IsStep(StoreMoveStep.SO_10_GoBack))
            { 
                if (AutoInout.autoNext)
                {
                    MoveInfo.NextMoveStep(StoreMoveStep.SO_11_WaitTrayGo);
                    InOutStoreLog(outType + "自动出入库,等待提升机构拿走料盘 或等待1000");
                    MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
                    MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.InDoor_Check, IO_VALUE.LOW));
                    MoveInfo.OneWaitCanEndStep = true;
                }
                else
                {
                    if (StoreManager.Store.MoveInfo.MoveType.Equals(MoveType.OutStore) && StoreManager.Store.MoveInfo.MoveStep.Equals(StoreMoveStep.LO_09_WaitOut))
                    {
                        bool result = StoreManager.Store.StartTrayOut(MoveInfo.MoveParam);
                        if (result)
                        {
                            MoveInfo.NextMoveStep(StoreMoveStep.SO_11_WaitTrayGo);
                            InOutStoreLog(outType + "等待提升机构拿走料盘 ");
                            MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
                            MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.InDoor_Check, IO_VALUE.LOW));

                            ClearTimeoutAlarm("提升机构夹爪开始取料");
                            ClearTimeoutAlarm("提升机构夹爪可以取料");
                        }
                        else if (MoveInfo.IsTimeOut(60))
                        {
                            WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 提升机构夹爪开始取料 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
                            LogUtil.error(WarnMsg, ID * 1000 + 30);
                            Alarm(AlarmType.IoSingleTimeOut);
                        }
                    }
                    else if (MoveInfo.IsTimeOut(60))
                    {
                        WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 等待 提升机构夹爪可以取料 超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
                        LogUtil.error(WarnMsg, ID * 1000 + 30);
                        Alarm(AlarmType.IoSingleTimeOut);
                    }
                }
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_11_WaitTrayGo))
            {
                TimeSpan span = DateTime.Now - startOutStoreTime;
                string posId = MoveInfo.MoveParam.PosID;
                LogUtil.info(Name + " 【" + posId + "】 出库结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");

                MoveEndP();
                AutoInout.InOutEndProcess(this, MoveType.OutStore);
            }
            #endregion


            #region 单盘出料,到出料口

            else if (MoveInfo.IsStep(StoreMoveStep.SO_21_ToOutDoor))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_22_OpenOutDoor);
                InOutStoreLog(outType + "打开出料口门  ");
                CylinderMove(MoveInfo, IO_Type.OutDoor_Down, IO_Type.OutDoor_Up);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_22_OpenOutDoor))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_23_InoutToP11);
                InOutStoreLog(outType + "进出轴到_P11-出料口取放料点 [" + Config.InOutAxis_P11 + "] ");
                InoutAxis.AbsMove(MoveInfo, Config.InOutAxis_P11, Config.InOutAxis_P11_Speed);
                //关闭舱门  
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_23_InoutToP11))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_24_PurReel);
                InOutStoreLog(outType + "升降轴到_P11-出料口-低点[" + Config.UpDownAxis_P11 + "],压紧轴到压紧前点P3 [" + moveP.ComPress_P3 + "]");

                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
                UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxis_P11, Config.UpDownAxis_P11_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_24_PurReel))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_25_InoutToP1);
                InOutStoreLog(outType + "进出轴返回待机点P1 [" + moveP.InOut_P1 + "] ");
                InOutBackToP1(moveP.InOut_P1);
            }
            else if (MoveInfo.IsStep( StoreMoveStep.SO_25_InoutToP1))
            {
                MoveInfo.NextMoveStep(StoreMoveStep.SO_26_GoBack);
                InOutStoreLog(outType + "升降轴到P1[" + moveP.UpDown_P1 + "],旋转轴到P1[" + moveP.Middle_P1 + "],压紧轴到P1[" + moveP.ComPress_P1 + "],关闭出料口门");
                CylinderMove(MoveInfo, IO_Type.OutDoor_Up, IO_Type.OutDoor_Down);
                ComAxis.AbsMove(MoveInfo, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
                MiddleAxis.AbsMove(MoveInfo, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
                UpdownAxis.AbsMove(MoveInfo, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
            }
            else if (MoveInfo.IsStep(StoreMoveStep.SO_26_GoBack))
            {
                TimeSpan span = DateTime.Now - startInStoreTime;
                string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
                LogUtil.info(Name + " 【" + posId + "】 单盘出库结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");

                MoveEndP();
                AutoInout.InOutEndProcess(this, MoveType.OutStore);
            }

            #endregion
            else
            {
                LogUtil.error(Name + " 出库处理,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
            }

        }

        #endregion


    }
}