/// <summary> /// 單一關節Jog移動 /// </summary> /// <param name="nRobotIndex">手臂代號</param> /// <param name="nJoint">關節代號</param> /// <param name="nDir">移動方向</param> /// <param name="dbSpeedPercentage">速度百分比</param> /// <returns>回傳是否成功,0:成功, 其他數字:失敗</returns> public int JogJoint(int nRobotIndex, Joints nJoint, Jog_Directions nDir, Jog_Speed nSpeed) { IRobotMotion.IRobotMotion IRobot = m_listRobots[nRobotIndex]; int nRet = IRobot.JogJoint(nJoint, nDir, nSpeed); return(nRet); /* * IRobotMotion.IRobotMotion IRobot = m_listRobots[nRobotIndex]; * double dbAcc = 0; * double dbDec = 0; * double dbSpeed = 0; * if (nSpeed == Jog_Speed.High) * { * dbAcc = 10000;dbDec = 10000; dbSpeed = 30; * } * * else if (nSpeed == Jog_Speed.Mid) * { dbAcc = 10000; dbDec = 10000; dbSpeed = 20; } * * else if (nSpeed == Jog_Speed.Mid) * { dbAcc = 10000; dbDec = 10000; dbSpeed = 10; } * * * double dbValue = 0; * if (nDir == Jog_Directions.Plus) * dbValue = 50; * else if (nDir == Jog_Directions.Minus) * dbValue = -50; * * int nRet = IRobot.MoveSingleJoint(nJoint, MovementsTypes.Abs, UnitTypes.Degree, SpeedTypes.Use, WaitTypes.NoWait, dbValue, dbAcc, dbDec, dbSpeed); */ return(nRet); }
//座標Jog 移動 public virtual int JogCoordnate(Coordnates nCoordnate, Jog_Directions nDir, Jog_Speed nSpeed) { int nRet = 0; double dbValue = 0; lock (thisLock) { /* * if (nSpeed == Jog_Speed.High) * nRet = SetAllSpeed(LINE, 300, 2000, 2000); * else if (nSpeed == Jog_Speed.Mid) * nRet = SetAllSpeed(LINE, 200, 1000, 1000); * else if (nSpeed == Jog_Speed.Low) * nRet = SetAllSpeed(LINE, 100, 500, 500); */ if (nSpeed == Jog_Speed.High) { nRet = SetAllSpeed(LINE, 20, 20, 20); } else if (nSpeed == Jog_Speed.Mid) { nRet = SetAllSpeed(LINE, 10, 10, 10); } else if (nSpeed == Jog_Speed.Low) { nRet = SetAllSpeed(LINE, 5, 5, 5); } if (nDir == Jog_Directions.Plus) { if (nCoordnate == Coordnates.X) { dbValue = 50; } else if (nCoordnate == Coordnates.Y) { dbValue = 50; } else if (nCoordnate == Coordnates.Z) { dbValue = 50; } else if (nCoordnate == Coordnates.Rx) { dbValue = 50; } else if (nCoordnate == Coordnates.Ry) { dbValue = 50; } else if (nCoordnate == Coordnates.Rz) { dbValue = 50; } } else { if (nCoordnate == Coordnates.X) { dbValue = -50; } else if (nCoordnate == Coordnates.Y) { dbValue = -50; } else if (nCoordnate == Coordnates.Z) { dbValue = -50; } else if (nCoordnate == Coordnates.Rx) { dbValue = -50; } else if (nCoordnate == Coordnates.Ry) { dbValue = -50; } else if (nCoordnate == Coordnates.Rz) { dbValue = -50; } } nRet = LineCoordnate(nCoordnate, MovementsTypes.Rel, SpeedTypes.NoUse, WaitTypes.NoWait, dbValue, 0, 0, 0); } return(0); }
//關節Jog 移動 public virtual int JogJoint(Joints nJoint, Jog_Directions nDir, Jog_Speed nSpeed) { int nRet = 0; double dbValue = 0; lock (thisLock) { if (nSpeed == Jog_Speed.High) { nRet = SetAllSpeed(P_TO_P, 30, 30, 30); } else if (nSpeed == Jog_Speed.Mid) { nRet = SetAllSpeed(P_TO_P, 20, 20, 20); } else if (nSpeed == Jog_Speed.Low) { nRet = SetAllSpeed(P_TO_P, 10, 10, 10); } if (nDir == Jog_Directions.Plus) { if (nJoint == Joints.J1) { dbValue = 170; } else if (nJoint == Joints.J2) { dbValue = 65; } else if (nJoint == Joints.J3) { dbValue = 200; } else if (nJoint == Joints.J4) { dbValue = 150; } else if (nJoint == Joints.J5) { dbValue = 120; } else if (nJoint == Joints.J6) { dbValue = 350; } } else { if (nJoint == Joints.J1) { dbValue = -170; } else if (nJoint == Joints.J2) { dbValue = -90; } else if (nJoint == Joints.J3) { dbValue = -40; } else if (nJoint == Joints.J4) { dbValue = -150; } else if (nJoint == Joints.J5) { dbValue = -130; } else if (nJoint == Joints.J6) { dbValue = -350; } } nRet = MoveJoint(nJoint, MovementsTypes.Abs, SpeedTypes.NoUse, WaitTypes.NoWait, dbValue, 0, 0, 0); } return(0); }
/* * STDMETHOD(LineSingleRel)(LONG lDirection, DOUBLE dbPos, LONG* lRet); * STDMETHOD(LineSingleRelWait)(LONG lDirection, DOUBLE dbPos, LONG* lRet); * STDMETHOD(LineSingleRelSpeed)(LONG lDirection, DOUBLE dbPos, DOUBLE dbSpeed, DOUBLE dbAcc, DOUBLE dbDec, LONG* lRet); * STDMETHOD(LineSingleRelSpeedWait)(LONG lDirection, DOUBLE dbPos, DOUBLE dbSpeed, DOUBLE dbAcc, DOUBLE dbDec, LONG* lRet); * STDMETHOD(LineSingleAbs)(LONG lDirection, DOUBLE dbPos, LONG* lRet); * STDMETHOD(LineSingleAbsWait)(LONG lDirection, DOUBLE dbPos, LONG* lRet); * STDMETHOD(LineSingleAbsSpeed)(LONG lDirection, DOUBLE dbPos, DOUBLE dbSpeed, DOUBLE dbAcc, DOUBLE dbDec, LONG* lRet); * STDMETHOD(LineSingleAbsSpeedWait)(LONG lDirection, DOUBLE dbPos, DOUBLE dbSpeed, DOUBLE dbAcc, DOUBLE dbDec, LONG* lRet); */ /// <summary> /// 單一關節Jog移動 /// </summary> /// <param name="nRobotIndex">手臂代號</param> /// <param name="nJoint">關節代號</param> /// <param name="nDir">移動方向</param> /// <param name="dbSpeedPercentage">速度百分比</param> /// <returns>回傳是否成功,0:成功, 其他數字:失敗</returns> public int JogCoordnate(int nRobotIndex, Coordnates nCoordnate, Jog_Directions nDir, Jog_Speed nSpeed) { IRobotMotion.IRobotMotion IRobot = m_listRobots[nRobotIndex]; int nRet = IRobot.JogCoordnate(nCoordnate, nDir, nSpeed); return(nRet); }
//座標Jog 移動 public virtual int JogCoordnate(Coordnates nCoordnate, Jog_Directions nDir, Jog_Speed nSpeed) { double dbValue = 0; lock (thisLock) { double dbSpeed = 0, dbAcc = 0, dbDec = 0; if (nSpeed == Jog_Speed.High) { dbSpeed = 15; dbAcc = 15; dbDec = 15; } else if (nSpeed == Jog_Speed.Mid) { dbSpeed = 8; dbAcc = 8; dbDec = 8; } else if (nSpeed == Jog_Speed.Low) { dbSpeed = 3; dbAcc = 3; dbDec = 3; } if (nDir == Jog_Directions.Plus) { if (nCoordnate == Coordnates.X) { dbValue = 50; } else if (nCoordnate == Coordnates.Y) { dbValue = 50; } else if (nCoordnate == Coordnates.Z) { dbValue = 50; } //else if (nCoordnate == Coordnates.Rx) dbValue = 20; else if (nCoordnate == Coordnates.Rx) { dbValue = 1.8; } else if (nCoordnate == Coordnates.Ry) { dbValue = 20; } else if (nCoordnate == Coordnates.Rz) { dbValue = 20; } } else { if (nCoordnate == Coordnates.X) { dbValue = -50; } else if (nCoordnate == Coordnates.Y) { dbValue = -50; } else if (nCoordnate == Coordnates.Z) { dbValue = -50; } //else if (nCoordnate == Coordnates.Rx) dbValue = -20; else if (nCoordnate == Coordnates.Rx) { dbValue = -1.97; } else if (nCoordnate == Coordnates.Ry) { dbValue = -20; } else if (nCoordnate == Coordnates.Rz) { dbValue = -20; } } int nRet = 0; nRet = LineCoordnate(nCoordnate, MovementsTypes.Rel, SpeedTypes.Use, WaitTypes.NoWait, dbValue, dbAcc, dbDec, dbSpeed); } return(0); }
//關節Jog 移動 public virtual int JogJoint(Joints nJoint, Jog_Directions nDir, Jog_Speed nSpeed) { double dbValue = 0; lock (thisLock) { double dbSpeed = 0, dbAcc = 0, dbDec = 0; if (nSpeed == Jog_Speed.High) { dbSpeed = 15; dbAcc = 15; dbDec = 15; } else if (nSpeed == Jog_Speed.Mid) { dbSpeed = 8; dbAcc = 8; dbDec = 8; } else if (nSpeed == Jog_Speed.Low) { dbSpeed = 3; dbAcc = 3; dbDec = 3; } if (nDir == Jog_Directions.Plus) { if (nJoint == Joints.J1) { dbValue = 359; } else if (nJoint == Joints.J2) { dbValue = 150; } else if (nJoint == Joints.J3) { dbValue = -30; } else if (nJoint == Joints.J4) { dbValue = 0; } else if (nJoint == Joints.J5) { dbValue = 359; } else if (nJoint == Joints.J6) { dbValue = 359; } } else { if (nJoint == Joints.J1) { dbValue = -359; } else if (nJoint == Joints.J2) { dbValue = -150; } else if (nJoint == Joints.J3) { dbValue = -138; } else if (nJoint == Joints.J4) { dbValue = -174; } else if (nJoint == Joints.J5) { dbValue = -359; } else if (nJoint == Joints.J6) { dbValue = -359; } } int nRet = 0; nRet = MoveJoint(nJoint, MovementsTypes.Abs, SpeedTypes.Use, WaitTypes.NoWait, dbValue, dbAcc, dbDec, dbSpeed); } return(0); }