예제 #1
0
        public Ut001_002_004_005()
        {
            try
            {
                DrawerKeys      = HalDrawerExtends.DrawerKeys;
                DrawerLocations = HalDrawerExtends.DrawerLocations;

                PositionInstance.Load(); // 在這裏載入所有(Boxtransfer 及 Masktransfer)的路徑點位資料
                pathFileObj = new BoxrobotTransferPathFile(PositionInstance.BTR_Path);

                HalContext = MacHalContextExtends.Create_MacHalContext_Instance();

                HalUniversal   = HalContext.GetUniversalAssembly();
                HalOpenStage   = HalContext.GetOpenStageAssembly();
                HalBoxTransfer = HalContext.GetBoxTransferAssembly();

                HalUniversal.HalConnect();
                HalOpenStage.HalConnect();
                HalBoxTransfer.HalConnect();


                // Initial
                //    HalOpenStage.ReadRobotIntrude(false, false);
                HalOpenStage.Initial();
                HalBoxTransfer.Initial();
                HalBoxTransfer.TurnOffCameraLight();
            }
            catch (Exception ex)
            {
                InitialError        = true;
                InitialErrorMessage = ex.Message;
            }
            // HalBoxTransfer.TurnToCB1Home();
        }
예제 #2
0
        public void Test_Ut003_CB_ByOP(bool autoConnect)
        {
            try
            {
                using (var halContext = MacHalContextExtends.Create_MacHalContext_Instance())
                {
                    var universal = halContext.GetUniversalAssembly(autoConnect);

                    universal.HalConnect();

                    for (var i = 0; i < DrawerKeys.Count; i++)
                    {
                        var drawer = halContext.GetDrawer(DrawerKeys[i], true);
                        Debug.WriteLine("Drawer Initial, DeviceIndex=" + drawer.DeviceId);
                        try
                        {
                            #region command
                            drawer.CommandINI();


                            #endregion command

                            //  drawer.CommandTrayMotionOut();
                            drawer.OnButtonEventHandler += (sender, e) =>
                            {
                                var rtnDrawer = ((IMacHalDrawer)sender);
                                Debug.WriteLine("(Ut003)Invoke OnButtonEventHandler,  Drawer= " + rtnDrawer.DeviceId);
                                rtnDrawer.CommandPositionRead();
                            };
                            drawer.OnPositionStatusHandler += (sender, e) =>
                            {
                                var eventArgs = (OnReplyPositionEventArgs)e;
                                var rtnDrawer = ((IMacHalDrawer)sender);
                                Debug.WriteLine("(Ut003)Invoke OnPositionStatusHandler,  Drawer= " + rtnDrawer.DeviceId + ", IHOStatus=" + eventArgs.IHOStatus);
                                if (eventArgs.IHOStatus == "111")   //在Home, 往外推
                                {
                                    rtnDrawer.CommandTrayMotionOut();
                                }
                                else
                                {
                                    rtnDrawer.CommandTrayMotionHome();
                                }
                            };
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine("Drawer Exception,  Message=" + ex.Message);
                        }
                    }

                    Repeat();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("MacHalContext Exception, Message=" + ex.Message);
            }
        }
예제 #3
0
        [DataRow(EnumMacMaskBoxType.IronBox, false)]// 鐵盒
        //[DataRow(BoxType.CrystalBox, false)]// 水晶盒
        public void Test_Ut003_CB(EnumMacMaskBoxType boxType, bool autoConnect)
        {
            Debug.WriteLine("---------MI-CT02-ST-003-------");
            Debug.WriteLine("BoxType=" + boxType.ToString());
            try
            {
                var BREAK_POINT = 0;
                using (var halContext = MacHalContextExtends.Create_MacHalContext_Instance())
                {
                    var universal = halContext.GetUniversalAssembly(autoConnect);
                    if (!autoConnect)
                    {
                        universal.HalConnect();
                    }
                    for (var i = 0; i < DrawerKeys.Count; i++)
                    {
                        var drawerKey      = DrawerKeys[i];
                        var drawerLocation = DrawerLocations[i];
                        Debug.WriteLine("Drawer Location=" + drawerLocation);
                        try
                        {
                            var drawer = halContext.GetDrawer(drawerKey);

                            Debug.WriteLine("Drawer DeviceIndex=" + drawer.DeviceId);
                            drawer.Initial();

                            /** 1. 操作人員透過S/W開啟Drawer (從Cabinet退出至機台外部) */
                            drawer.MoveTrayToOut();

                            /** 2. 操作人員將光罩鐵盒放入Drawer內*/
                            BREAK_POINT = 0; // 確認

                            /** 3. 操作人員透過S/W將Drawer送回Cabinet內*/
                            drawer.MoveTrayToHome();

                            /** 3.1 如果需要, 讓 Drawer Tray 移出 取出Box*/
                            drawer.MoveTrayToOut();

                            BREAK_POINT = 0;

                            /** 3.2 如果 3.1 有操作, 也要將 Tray 移回 Home*/
                            drawer.MoveTrayToHome();
                            Debug.WriteLine("OK");
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine("Drawer Exception,  Message=" + ex.Message);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("MacHalContext Exception, Message=" + ex.Message);
            }
        }
예제 #4
0
        public void TestCreateDrawerInstance(bool autoConnect)
        {
            string str = System.Environment.CurrentDirectory;

            using (var halContext = MacHalContextExtends.Create_MacHalContext_Instance())
            {
                var universal   = halContext.GetUniversalAssembly(autoConnect);
                var boxTransfer = halContext.GetBoxTransferAssembly(autoConnect);
                var cabinet     = halContext.GetCabinetAssembly(autoConnect);
                var openStage   = halContext.GetOpenStageAssembly(autoConnect);
                universal.HalConnect();
                boxTransfer.HalConnect();
                // boxTransfer.CameraShot("TTTTTTT");

                //   halContext.DrawersConnect();
                // connect 所有 Drawer
                // halContext.DrawersConnect();
                for (var i = 0; i < 2; i++)
                {
                    try
                    {
                        var drawer = halContext.GetDrawer(DrawerKeys[i], false);
                        drawer.CommandINI();

                        Debug.WriteLine(DrawerKeys[i] + ", OK");
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine(DrawerKeys[i] + ", Error:" + ex.Message);
                    }
                }

                /*
                 * if (!autoConnect)
                 * {
                 *  universal.HalConnect();
                 *  boxTransfer.HalConnect();
                 *  cabinet.HalConnect();
                 *  openStage.HalConnect();
                 * }*/
                // connect 所有 Drawer
                //  halContext.DrawersConnect();

                /**
                 * var lpB = halContext.HalDevices[MacEnumDevice.loadportB_assembly.ToString()] as MacHalLoadPort;
                 * lpB.HalConnect();
                 * var lb = lpB.LoadPortUnit;
                 * var lpA = halContext.HalDevices[MacEnumDevice.loadportA_assembly.ToString()] as MacHalLoadPort;
                 * lpA.HalConnect();
                 * var la = lpA.LoadPortUnit;
                 */
            }
            Repeat();
        }
예제 #5
0
 public void test()
 {
     using (var halContext = MacHalContextExtends.Create_MacHalContext_Instance())
     {
         var boxTransfer = halContext.GetBoxTransferAssembly(false);
         //   boxTransfer.TurnToCB1Home();
         // boxTransfer.TurnToCB2Home();
         var path1 = pathFileObj.FromCabinet01HomeToDrawer_PUT_PathFile(BoxrobotTransferLocation.Drawer_01_05);
         var path2 = pathFileObj.FromCabinet02HomeToDrawer_PUT_PathFile(BoxrobotTransferLocation.Drawer_04_05);
     }
 }
예제 #6
0
        public void Test_Drawer()
        {
            try
            {
                using (var halContext = MacHalContextExtends.Create_MacHalContext_Instance())
                {
                    var universal = halContext.GetUniversalAssembly(true);
                    universal.HalConnect();

                    // get drawer
                    var drawer0 = halContext.GetDrawer(EnumMacDeviceId.cabinet_drawer_01_04, true);
                    // var drawer1 = halContext.GetDrawer(MacEnumDevice.cabinet_drawer_04_02, true);
                    //var drawer2 = halContext.GetDrawer(MacEnumDevice.cabinet_drawer_04_04, true);
                    //var drawer3 = halContext.GetDrawer(MacEnumDevice.cabinet_drawer_03_02, true);
                    //var drawer4 = halContext.GetDrawer(MacEnumDevice.cabinet_drawer_03_03, true);
                    //var drawer5 = halContext.GetDrawer(MacEnumDevice.cabinet_drawer_03_04, true);
                    //   drawer0.CommandTrayMotionIn();
                    //  drawer1.CommandTrayMotionIn();
                    //  drawer2.CommandTrayMotionIn();
                    // drawer3.CommandTrayMotionIn();
                    // drawer4.CommandTrayMotionIn();
                    // drawer5.CommandTrayMotionIn();
                    //drawer0.MoveTrayToHome();
                    //drawer1.MoveTrayToHome();
                    //drawer2.MoveTrayToHome();
                    drawer0.CommandINI();


                    // drawer command

                    Repeat();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("MacHalContext Exception, Message=" + ex.Message);
            }
        }
예제 #7
0
        [DataRow(EnumMacMaskBoxType.IronBox, false)] // 鐵盒
        //[DataRow(BoxType.CrystalBox,false)]// 水晶盒
        public void Test_Ut001_BT(EnumMacMaskBoxType boxType, bool autoConnect)
        {
            var BREAK_POINT = 0;

            using (var halContext = MacHalContextExtends.Create_MacHalContext_Instance())
            {
                try
                {
                    var universal   = halContext.GetUniversalAssembly(autoConnect);
                    var boxTransfer = halContext.GetBoxTransferAssembly(autoConnect);
                    var cabinet     = halContext.GetCabinetAssembly(autoConnect);
                    var openStage   = halContext.GetOpenStageAssembly(autoConnect);

                    if (!autoConnect)
                    {
                        universal.HalConnect();
                        boxTransfer.HalConnect();
                        cabinet.HalConnect();
                        openStage.HalConnect();
                    }

                    // Initial OpenStage
                    openStage.Initial();
                    openStage.SetBoxType((uint)boxType);
                    openStage.SortClamp();
                    // Initial BoxTransfer
                    boxTransfer.Initial();
                    // 關燈
                    boxTransfer.TurnOffCameraLight();


                    // connect 所有 Drawer
                    halContext.DrawersConnect();



                    for (int i = 0; 0 < DrawerKeys.Count; i++)
                    {
                        try
                        {
                            // 取得 Drawer
                            var drawer = halContext.GetDrawer(DrawerKeys[i]);
                            // Drawer  代碼
                            var drawerLocation = DrawerLocations[i];
                            // Drawer Home
                            var drawerHome = DrawerLocations[i].GetCabinetHomeCode().Item2;
                            // Drawer Initial
                            drawer.Initial();
                            // boxTransfer 轉向 Cabitnet 1 Home
                            boxTransfer.TurnToCB1Home();


                            BREAK_POINT = 0;


                            /** 1 光罩鐵盒放置於Open Stage平台上*/


                            BREAK_POINT = 0;   // 確認 光罩鐵盒放置於Open Stage平台上*/


                            /** 2. Drawer往機台內部移動到光罩盒可放置的位置 */
                            // 將 Drawer 的Tray 移到 In
                            drawer.MoveTrayToIn();


                            BREAK_POINT = 0;

                            /** 3. Box Robot從Home點至Open Stage進行光罩鐵盒夾取*/
                            //  3.1 能否入侵 Open Stage?
                            openStage.SetRobotIntrude(true, null);
                            //  3.2 將 Boxrobot 移到 OpenStage
                            var path = pathFileObj.FromCabinet01HomeToOpenStage_GET_PathFile();
                            openStage.SortUnclamp();
                            openStage.Lock();
                            boxTransfer.Move(path);

                            boxTransfer.Clamp((uint)boxType);

                            BREAK_POINT = 0;

                            /** 4. Box Robot從Open Stage夾持光罩至Drawer放置點位之前一個點位 (暫且定義為 CB1 Home 或CB2 Home) */
                            path = pathFileObj.FromOpenStageToCabinet01Home_GET_PathFile();
                            boxTransfer.Move(path);
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                boxTransfer.TurnToCB2Home();
                            }

                            #region 拍照 , 移到 6~7 間
                            // 5. (編號13-CCD): 開啟光源 -> 拍照(FOV正確) -> 關閉光源, 確認Drawer中無光罩盒
                            #endregion


                            BREAK_POINT = 0;

                            /** 6. Box Robot從Open Stage夾持光罩至Drawer放置點位 (不做放置光罩鐵盒於drawer的動作) */
                            //  將 BoxRobot 移到 Drawer
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_01_Home)
                            {
                                path = pathFileObj.FromCabinet01HomeToDrawer_PUT_PathFile(drawerLocation);
                            }
                            else  //if(drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                boxTransfer.TurnToCB2Home();

                                path = pathFileObj.FromCabinet02HomeToDrawer_PUT_PathFile(drawerLocation);
                            }


                            boxTransfer.Move(path);

                            //  拍照
                            //  boxTransfer.CameraShot("Ut001_BT_" + drawerLocation);


                            BREAK_POINT = 0;


                            /** 7. Box Robot夾持光罩回到Drawer entry點位 (目前没有 teach Drawer entry 點 這個點位, 改以 回到 CB1_HOME 或 CB2_Home)*/
                            //   7.1 以Get 方式回到 Cb1Home(目前有盒子)
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_01_Home)
                            {  // cabinet 1
                                path = pathFileObj.FromDrawerToCabinet01Home_GET_PathFile(drawerLocation);
                            }
                            else if (drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {   // cabinet 2
                                path = pathFileObj.FromDrawerToCabinet02Home_GET_PathFile(drawerLocation);
                            }
                            boxTransfer.Move(path);
                            //   7.2 如果 Drawer 是 Cabinet 2的Drawer, 再回到 Cabitnet 1 Home
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                boxTransfer.TurnToCB1Home();
                            }
                            //   7.3 檢查入侵到 Open Stage
                            openStage.SetRobotIntrude(true, null); // 入侵
                            path = pathFileObj.FromCabinet01HomeToOpenStage_PUT_PathFile();
                            //    7.4 BoxTransfer 移到 OpenStage
                            boxTransfer.Move(path);
                            //   7.5 放下盒子
                            boxTransfer.Unclamp();    // => 第二 個以後Drawer(01_03, 01_04 ,......, 07_03)  的 1.
                            //   7.6 Box robot 回CB1Home
                            path = pathFileObj.FromOpenStageToCabinet01Home_PUT_PathFile();
                            boxTransfer.Move(path);



                            BREAK_POINT = 0;


                            // 8. Drawer回到Cabinet內
                            drawer.MoveTrayToHome();

                            // 9. 重複1~8步驟, 完成20個Drawer的光罩鐵盒的移動測試(下個 Cycle)
                            //10.重複1~8步驟, 完成20個Drawer的光罩水晶盒的移動測試
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
                catch (Exception ex)
                {
                    MvaLog.WarnNs(this, ex);
                }
            };
        }
예제 #8
0
        [DataRow(EnumMacMaskBoxType.CrystalBox, true)]  // 水晶盒
        public void Test_Ut002_BT(EnumMacMaskBoxType boxType, bool autoConnect)
        {
            var BREAK_POINT = 0;

            using (var halContext = MacHalContextExtends.Create_MacHalContext_Instance())
            {
                try
                {
                    var    universal      = halContext.GetUniversalAssembly(autoConnect);
                    var    boxTransfer    = halContext.GetBoxTransferAssembly(autoConnect);
                    var    openStage      = halContext.GetOpenStageAssembly(autoConnect);
                    var    cabinet        = halContext.GetCabinetAssembly(autoConnect);
                    string btMovePathFile = default(string);
                    if (!autoConnect)
                    {
                        universal.HalConnect();
                        boxTransfer.HalConnect();
                        cabinet.HalConnect();
                        openStage.HalConnect();
                    }


                    openStage.Initial();
                    boxTransfer.Initial();
                    boxTransfer.TurnOffCameraLight();


                    halContext.DrawersConnect();


                    for (var i = 0; i < DrawerKeys.Count; i++)
                    {
                        try
                        {
                            BREAK_POINT = 0;

                            var drawerLocation = DrawerLocations[i];
                            var drawer         = halContext.GetDrawer(DrawerKeys[i]);

                            var drawerHome = drawerLocation.GetCabinetHomeCode().Item2;

                            drawer.Initial();

                            /** 01 光罩鐵盒放置於Drawer內*/
                            // [1.1] Tray 移到 Out
                            drawer.MoveTrayToOut();
                            // [1.2] 移到 Out 之後等待手動放入鐵盒

                            BREAK_POINT = 0;

                            /** 02 Drawer往機台內部移動到Box Robot可以取得光罩的位置*/
                            drawer.MoveTrayToHome();
                            drawer.MoveTrayToIn();

                            BREAK_POINT = 0;


                            /** 03 Box Robot從Home點至Drawer夾取前的檢查點位*/
                            // 3.1 BoxTransfer 轉到 Cabitnet 1 Home
                            boxTransfer.TurnToCB1Home();
                            //*******[BR]*******
                            // 3.2 如果是 Cabitnet 2 的Drawer, 再轉到 Cabinet 2 Home
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                boxTransfer.TurnToCB2Home();
                            }


                            BREAK_POINT = 0;


                            /** 04 (編號13-CCD): 開啟光源 -> 拍照(FOV正確) -> 關閉光源, 確認Drawer中有光罩鐵盒*/ //(移到5.1 ~ 5.2)



                            BREAK_POINT = 0;


                            /** 5 Box Robot移動至Drawer夾取點, 進行光罩鐵盒夾取 (clamp光罩鐵盒)*/
                            // 5.1 Boxtransfer 移到夾取點
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_01_Home)
                            {                                                                                        // Cabinet 1  Drawer 的 Path
                                btMovePathFile = pathFileObj.FromCabinet01HomeToDrawer_GET_PathFile(drawerLocation); // Box Transfer 要去 Drawer 夾盒子, 所以用 GET
                            }
                            else //if(drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                //Cabinet 2 Drawer 的 Path
                                btMovePathFile = pathFileObj.FromCabinet02HomeToDrawer_GET_PathFile(drawerLocation); // Box Transfer 要去 Drawer 夾盒子, 所以用 GET
                            }
                            boxTransfer.Move(btMovePathFile);


                            // 照相
                            // boxTransfer.CameraShot("Ut002_BT_" + drawerLocation);


                            // 5.2 夾取
                            boxTransfer.Clamp((uint)boxType);

                            BREAK_POINT = 0;

                            /** 6 Box Robot將光罩鐵盒從Drawer移動至Open Stage Entry處*/
                            // 6.1 回到 Cabinet 1 Home
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_01_Home)
                            {
                                btMovePathFile = pathFileObj.FromDrawerToCabinet01Home_GET_PathFile(drawerLocation); // Box Transfer 夾到盒子後,由 Drawer 回到 Home, 用GET
                            }
                            else // if(drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                btMovePathFile = pathFileObj.FromDrawerToCabinet02Home_GET_PathFile(drawerLocation);// Box Transfer 夾到盒子後,由 Drawer 回到 Home, 用GET
                            }
                            boxTransfer.Move(btMovePathFile);
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                boxTransfer.TurnToCB1Home();
                            }
                            // 6.2 boxrobot 移到 OpenStage
                            openStage.SetRobotIntrude(true, null);
                            btMovePathFile = pathFileObj.FromCabinet01HomeToOpenStage_PUT_PathFile(); // boxrobot 目前有盒子, 要到 Open Stage, 用PUT
                            boxTransfer.Move(btMovePathFile);


                            BREAK_POINT = 0;

                            /** 7 Box Robot將光罩鐵盒從Open Stage Entry處, 移至Drawer可放置光罩盒的位置, 並且放置光罩鐵盒 (release光罩鐵盒)*/
                            // 7.1 Boxtransfer 回到 Cabinet 1 Home
                            btMovePathFile = pathFileObj.FromOpenStageToCabinet01Home_GET_PathFile(); // boxrobot 目前有盒子,要回到 Cabinet 1 Home, 用 GET
                            boxTransfer.Move(btMovePathFile);
                            // 7.2 如果是 Cabinet 2 的 Drawer, 轉向 Cabinet 2 Home
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                boxTransfer.TurnToCB2Home();
                            }
                            // 7.3 移到 Drawer
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_01_Home)
                            {
                                btMovePathFile = pathFileObj.FromCabinet01HomeToDrawer_PUT_PathFile(drawerLocation); // boxrobot 目前有盒子,要到 Drawer, 所以用 PUT
                            }
                            else //if(drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                btMovePathFile = pathFileObj.FromCabinet01HomeToDrawer_PUT_PathFile(drawerLocation); // boxrobot 目前有盒子,要到 Drawer, 所以用 PUT
                            }
                            boxTransfer.Move(btMovePathFile);
                            // 7.3 放下 Box
                            boxTransfer.Unclamp();

                            BREAK_POINT = 0;

                            /** 8 Box Robot (無夾持光罩盒) 從Drawer移回Home點*/
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_01_Home)
                            {
                                btMovePathFile = pathFileObj.FromDrawerToCabinet01Home_PUT_PathFile(drawerLocation); //
                            }
                            else //if(drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                btMovePathFile = pathFileObj.FromDrawerToCabinet02Home_PUT_PathFile(drawerLocation); // T
                            }
                            boxTransfer.Move(btMovePathFile);
                            if (drawerHome == BoxrobotTransferLocation.Cabinet_02_Home)
                            {
                                boxTransfer.TurnToCB1Home();
                            }
                            BREAK_POINT = 0;

                            /** 9 Drawer回到Cabinet內*/
                            drawer.MoveTrayToHome();

                            BREAK_POINT = 0;
                            drawer.MoveTrayToOut(); //取出盒子

                            BREAK_POINT = 0;

                            // 取出盒子後回到 HOME
                            drawer.MoveTrayToHome();



                            // 10.重複1~9步驟, 完成20個Drawer的光罩鐵盒測試
                        }
                        catch (Exception ex)
                        {
                        }
                    }

                    //12.重複1~9步驟, 完成20個Drawer的光罩盒測試
                }
                catch (Exception ex)
                {
                }
            }
        }