2 wangying20062880 wangying20062880 于 2013.09.05 19:32 提问

C#定时器问题求助高手

void BinLoadTimer_Tick(object sender, EventArgs e)
{
double pos = new double();
IntPtr handle = GlobalVar.AxisHandle[(int)Motor.BinGripper];
//夹爪移动到准备位置
if (binGripperAction == 0)
{
AxisMotion.AxisMoveAbs(handle, MotionPar.BT_GripperReadyPos * binGripperMultiple);
binGripperAction++;
}

            if (binGripperAction == 2 && Math.Abs(pos - MotionPar.BT_GripperReadyPos) <= 5)
            {
       double pos1 = new double();
       if(btnlim.Backcolor==Color.Red)

               {
                    AxisMotion.AxisMoveAbs(handle, MotionPar.BT_GripperBufferUnloadPos * binGripperMultiple);//夹爪移动到缓冲器位置 
                    binGripperAction++;
                 //夹爪移动到卸载位置
                if (binGripperAction == 3)
                {
                     AxisMotion.AxisMoveAbs(handle, MotionPar.BT_GripperUnloadPos * binGripperMultiple);
                     binGripperAction++;
                } 
       }     
             else
            {
                    AxisMotion.AxisMoveAbs(handle, MotionPar.BT_GripperLoadPos * binGripperMultiple);
                    binGripperAction++;   
                 //夹爪移动到卸载位置
                 if (binGripperAction == 3)
                {
                        AxisMotion.AxisMoveAbs(handle, MotionPar.BT_GripperUnloadPos * binGripperMultiple);
                        binGripperAction++;
                 }

          } 
   }    
            //夹爪移动到准备位置
            if (binGripperAction ==4)
            {
                binGripperAction++;
            }
    }

程序只执行到夹爪移动到缓冲器位置,binGripperAction == 3,不执行,程序应该怎么改

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!