Esempio n. 1
0
    private void CLAMPA_DOING()
    {
        // ----------------------------------------------------
        // 至下点
        bool isOver = false;
        while (!isOver)
        {
            isOver = Z_TO(loadPoints[currTask.AB_TASK_A].Z, 1);       // 下点
            if (!drawOnly)
            {
                isOver &= ABTask.Z_TO(true, ABTask.loadPoints[currTask.AB_TASK_A].Z, ABTask.zSpeed);
            }
            Thread.Sleep(10);
        }

        //
        isOver = false;
        while (!isOver)
        {
            isOver = CLAMP_DO();       // 夹紧
            if (!drawOnly)
            {
                isOver &= ABTask.CLAMP_DO();
            }
            Thread.Sleep(10);
        }
    }
Esempio n. 2
0
    private void RELAXB_DOING()
    {
        // ----------------------------------------------------
        // 至下点
        bool isOver = false;

        while (!isOver)
        {
            isOver = Z_TO(loadPoints[currTask.AB_TASK_B].Z, 1);       // 下点
            if (!drawOnly)
            {
                isOver = ABTask.Z_TO(true, ABTask.loadPoints[currTask.AB_TASK_B].Z, ABTask.zSpeed);
            }
            Thread.Sleep(10);
            int b = currTask.AB_TASK_A;
        }
        //
        isOver = false;
        while (!isOver)
        {
            isOver = CLAMP_RELAX_DO();       // 松开
            if (!drawOnly)
            {
                isOver = ABTask.CLAMP_RELAX_DO();
            }
            Thread.Sleep(10);
        }
    }
Esempio n. 3
0
 public void ManualClamp()
 {
     //
     bool isOver = false;
     while (!isOver)
     {
         //isOver = CLAMP_DO();       // 夹紧
         if (!drawOnly)
         {
             isOver &= ABTask.CLAMP_DO();
         }
         Thread.Sleep(10);
     }
 }
Esempio n. 4
0
    private void AFTER_B_DOING()
    {
        // 至上点
        bool isOver = false;

        while (!isOver)
        {
            isOver = Z_TO(zeroPos.Z, 1);       // 上点
            if (!drawOnly)
            {
                isOver = ABTask.Z_TO(true, ABTask.zeroPos.Z, ABTask.zSpeed);
            }
            Thread.Sleep(10);
        }

        int b      = currTask.AB_TASK_B;
        int rest_p = currTask.AB_TASK_B;

        if (taskList.Count == 1)
        {// X 横向移动到休息位休息
            if (b == 3 || b == 4)
            {
                rest_p = 2;
            }
            if (b == 5 || b == 6)
            {
                rest_p = 7;
            }
            if (b == 11 || b == 12)
            {
                rest_p = 10;
            }
            if (b > 12)
            {
                rest_p = 0;
            }

            isOver = false;
            while (!isOver)
            {
                isOver = X_TO(loadPoints[rest_p].X, 50);     // 平移至休息位
                if (!drawOnly)
                {
                    isOver = ABTask.X_TO(true, ABTask.loadPoints[rest_p].X, ABTask.xSpeed);     // 平移至休息位
                }
                Thread.Sleep(10);
            }
        }
    }
Esempio n. 5
0
 public void ManualHorizontalMove(int pos_index)
 {
     // ----------------------------------------------------
     // 水平方向运动
     bool isOver = false;
     while (!isOver)
     {
         isOver = ManualX_TO(loadPoints[pos_index].X, 50);     // 平移 --> A
         if (!drawOnly)
         {
             isOver &= ABTask.X_TO_MANUAL(true, ABTask.loadPoints[pos_index].X, ABTask.xSpeed);     // 平移 --> A
         }
         Thread.Sleep(10);
     }
 }
Esempio n. 6
0
 public void ManualDown(int pos_index)
 {
     // ----------------------------------------------------
     // 至下点
     bool isOver = false;
     while (!isOver)
     {
         isOver = ManualZ_TO(loadPoints[pos_index].Z, 1);       // 下点
         if (!drawOnly)
         {
             isOver &= ABTask.Z_TO_MANUAL(true, ABTask.loadPoints[pos_index].Z, ABTask.zSpeed);
         }
         Thread.Sleep(10);
     }
 }
Esempio n. 7
0
 public void ManualUp()
 {
     // ----------------------------------------------------
     // 至上点
     bool isOver = false;
     while (!isOver)
     {
         isOver = ManualZ_TO(zeroPos.Z, 1);       // 上点
         if (!drawOnly)
         {
             isOver &= ABTask.Z_TO_MANUAL(true, ABTask.zeroPos.Z, ABTask.zSpeed);
         }
         Thread.Sleep(10);
     }
 }
Esempio n. 8
0
 private void PRE_A_DOING()
 {
     bool isOver = false;
     // ----------------------------------------------------
     // 松夹爪
     while (!isOver)
     {
         isOver = CLAMP_RELAX_DO();// 松开
         if (!drawOnly)
         {
             isOver &= ABTask.CLAMP_RELAX_DO();
         }
         Thread.Sleep(10);
     }
     PRE_DOING(currTask.AB_TASK_A);
 }
Esempio n. 9
0
    public ABTask LoadXmlNodeTaskInfo()
    {
        if (xmlDoc == null)
        {
            xmlDoc = new XmlDocument();
            xmlDoc.Load(xmlName); //加载xml文件
            xroot = xmlDoc.SelectSingleNode("task");
        }

        XmlNodeList xnl  = xroot.ChildNodes;
        ABTask      task = null;

        foreach (hyWorkFlow wf in workGroup.workFlowList)
        {
            if (wf.carrier.status == hyCarrier.STATUS.DOING_CHANGE_OVER)
            {                                                                           // 寻找当前正在换型的夹具
                if (wf.carrier.id == Convert.ToInt32(xnl[3].InnerText))
                {                                                                       // 确定夹具ID是一致的(复查)
                    task            = new ABTask(wf);
                    task.taskStatus = (ABTask.STATUS)Convert.ToInt32(xnl[0].InnerText); // task_status
                    task.AB_TASK_A  = Convert.ToInt32(xnl[1].InnerText);                // A
                    task.AB_TASK_B  = Convert.ToInt32(xnl[2].InnerText);                // B

                    task.carrier = wf.carrier;
                    currCarrier  = wf.carrier;
                    carrierList.Add(currCarrier);
                    int p = task.AB_TASK_A;
                    switch (task.taskStatus)
                    {
                    case ABTask.STATUS.IDLE:
                    case ABTask.STATUS.PREA:
                    case ABTask.STATUS.CLAMPA:
                        p = task.AB_TASK_A;
                        break;

                    default:
                        p = task.AB_TASK_B;
                        break;
                    }
                    currCarrier.currPosDraw = new ServoPoint(loadPoints[p].X, loadPoints[p].Z);
                    currPosDraw             = new ServoPoint(currCarrier.currPosDraw.X, currCarrier.currPosDraw.Z);
                    taskList.Add(task);
                }
            }
        }
        return(task);
    }
Esempio n. 10
0
    private void AFTER_B_DOING()
    {
        // 至上点
        bool isOver = false;
        while (!isOver)
        {
            isOver = Z_TO(zeroPos.Z, 1); // 上点
            GenericOp.GREASEnum++; //每个AB流程中会有两次z轴上升运动,计数
            if (!drawOnly)
            {
                isOver &= ABTask.Z_TO(true, ABTask.zeroPos.Z, ABTask.zSpeed);
            }
            Thread.Sleep(10);
        }

        int b = currTask.AB_TASK_B;
        int rest_p = currTask.AB_TASK_B;
        if (taskList.Count == 1)
        {// X 横向移动到休息位休息
            if (b == 3 || b == 4) rest_p = 2;
            if (b == 5 || b == 6) rest_p = 7;
            if (b >= 9) rest_p = 2;

            isOver = false;
            while (!isOver)
            {
                isOver = X_TO(loadPoints[rest_p].X, 50);     // 平移至休息位
                if (!drawOnly)
                {
                    isOver &= ABTask.X_TO(true, ABTask.loadPoints[rest_p].X, ABTask.xSpeed);     // 平移至休息位
                }
                Thread.Sleep(10);
            }
            /*if (currTask.AB_TASK_B == hyWorkFlow.POS_UNLOAD)//关闭后门
            {
                SerialManual.CloseStoveLid(8);
            }*/
        }
    }
Esempio n. 11
0
    private void PRE_DOING(int pos_index)
    {
        // ----------------------------------------------------
        // 至上点
        bool isOver = false;

        while (!isOver)
        {
            isOver = Z_TO(zeroPos.Z, 1);       // 上点
            if (!drawOnly)
            {
                isOver = ABTask.Z_TO(true, ABTask.zeroPos.Z, ABTask.zSpeed);
            }
            Thread.Sleep(10);
        }
        if (!drawOnly)
        {
            int a = currTask.AB_TASK_A;
            if ((a == 6 || a == 11 || a == 12 || a == 10) && SerialWireless.GetGtryState(SerialWireless.GTRY_STATE_CLAMP))
            {
                Thread.Sleep(100000);
            }
        }

        // 判断炉盖的状态,如果炉盖已经打开,则允许前行,否则不允许前行
        // 需要打开炉盖的炉子有    _ _ _ 3、4、5、6 _ _ _ 10、11、12
        if (!drawOnly)
        {
            int openStoveLidIndex;
            for (openStoveLidIndex = 0; openStoveLidIndex < 7; openStoveLidIndex++)
            {
                if (stoveLidAction[openStoveLidIndex] == STOVE_LID_ACTION.OPEN)
                {
                    break;// 发现有炉盖需要打开
                }
            }

            //
            SerialManual.STOVE_LID_STATE state;
            if (openStoveLidIndex < 7)
            {
                // 有炉盖需要打开,则不断等待炉盖打开到位信号。
                state = SerialManual.stoveLidState[openStoveLidIndex];     // 查看当前这个炉盖的状态
                while (state != SerialManual.STOVE_LID_STATE.OPENED)
                {                                                          // 等待炉盖打开到位信号。
                    Thread.Sleep(100);                                     // 等待炉盖打开
                    state = SerialManual.stoveLidState[openStoveLidIndex]; // 查看当前这个炉盖的状态

                    // 超时处理
                    // TODO: 如果60秒都没有等到炉盖打开的话,需要给出提示信息。告诉用户炉盖故障:接近开关故障。
                    timeout_openStoveLid++;
                    if (timeout_openStoveLid > 600)
                    {
                        GenericOp.errCode |= 0x01;
                    }
                }
                GenericOp.errCode &= ~0x01;
            }
        }

        // ----------------------------------------------------
        // 进入 A或者B 点区域
        isOver = false;
        while (!isOver)
        {
            isOver = X_TO(loadPoints[pos_index].X, 50);     // 平移 --> A
            if (!drawOnly)
            {
                isOver = ABTask.X_TO(true, ABTask.loadPoints[pos_index].X, ABTask.xSpeed);     // 平移 --> A
            }
            Thread.Sleep(10);
        }
    }