// ReSharper disable InconsistentNaming public static bool XYPMoveAbsolutUseTMode(Axis axisX, Axis axisY, float x, float y) // ReSharper restore InconsistentNaming { bool OrderIsCompeleted = false; int xposition = Convert.ToInt32(x * axisX.PulseOfPerMilMeter); int yposition = Convert.ToInt32(y * axisY.PulseOfPerMilMeter); if (axisX.MaxRouteDistance > xposition && (xposition >= 0)) { if (axisY.MaxRouteDistance > yposition && (yposition >= 0)) { axisX.SetTModeProfile(); } axisY.SetTModeProfile(); if (AxisQueryStatus(axisX) && AxisQueryStatus(axisY)) { Dmc2610.d2610_t_pmove(axisX.AxisId, xposition, (ushort)AxisPositionMode.Absolut); Dmc2610.d2610_t_pmove(axisY.AxisId, yposition, (ushort)AxisPositionMode.Absolut); //while ((!GetAxisIsINPON(axisX)) && (!GetAxisIsINPON(axisY))) //{ //} while (!(GetAxisIsDoWell(axisX) && (GetAxisIsDoWell(axisY)))) { } OrderIsCompeleted = true; } } return(OrderIsCompeleted); }
public static bool SigelAxisPMoveAbsolutUseTMode(Axis axis, float dis) { bool OrderIsCompeleted = false; int position = Convert.ToInt32(dis * axis.PulseOfPerMilMeter); if (axis.MaxRouteDistance > position && (position >= 0)) { axis.SetTModeProfile(); if (AxisQueryStatus(axis)) { Dmc2610.d2610_t_pmove(axis.AxisId, position, (ushort)AxisPositionMode.Absolut); while (!GetAxisIsDoWell(axis)) { } OrderIsCompeleted = true; } } return(OrderIsCompeleted); }
public static void HomeMove(Axis axis) { if ((axis.axisTModeMoveParameters.MaxVelocity > 0) && (axis.axisTModeMoveParameters.MaxVelocity < 50000000)) { if (!((Dmc2610.d2610_read_RDY_PIN(axis.AxisId) == 0) && (GetAxisIsALMON(axis)) && (GetAxisIsEMGON(axis)))) { if (!(GetAxisIsNELON(axis) && GetAxisIsPELON(axis))) { if (!(GetAxisIsORGON(axis))) { axis.SetResetModeProfile(); Dmc2610.d2610_home_move(axis.AxisId, (ushort)AxisHomeMoveDirection.Reverse, (ushort)AxisHomeVelocityMode.SlowlySpeedandStop); } else { if ((GetAxisIsORGON(axis))) { axis.SetResetModeProfile(); Dmc2610.d2610_t_pmove(axis.AxisId, 10000, (ushort)AxisPositionMode.Relation); while (!GetAxisIsDoWell(axis)) { } axis.SetResetModeProfile(); Dmc2610.d2610_home_move(axis.AxisId, (ushort)AxisHomeMoveDirection.Reverse, (ushort)AxisHomeVelocityMode.SlowlySpeedandStop); while (!GetAxisIsDoWell(axis)) { } Dmc2610.d2610_set_position(axis.AxisId, 0); } } } else { if (GetAxisIsNELON(axis) && (!GetAxisIsPELON(axis))) { axis.SetResetModeProfile(); Dmc2610.d2610_t_pmove(axis.AxisId, 10000, (ushort)AxisPositionMode.Relation); while (!GetAxisIsDoWell(axis)) { } axis.SetResetModeProfile(); Dmc2610.d2610_home_move(axis.AxisId, (ushort)AxisHomeMoveDirection.Reverse, (ushort)AxisHomeVelocityMode.SlowlySpeedandStop); } else { axis.SetResetModeProfile(); Dmc2610.d2610_home_move(axis.AxisId, (ushort)AxisHomeMoveDirection.Reverse, (ushort)AxisHomeVelocityMode.SlowlySpeedandStop); } } while (!GetAxisIsDoWell(axis)) { } //axis.SetTModeProfile(); //Dmc2610.d2610_t_pmove(axis.AxisId, axis.LogicOrgPosition, (ushort)AxisPositionMode.Relation); axis.SetResetModeProfile(); Dmc2610.d2610_set_position(axis.AxisId, 0); Dmc2610.d2610_t_pmove(axis.AxisId, axis.LogicOrgPosition, (ushort)AxisPositionMode.Absolut); while (!GetAxisIsDoWell(axis)) { } Thread.Sleep(500); Dmc2610.d2610_set_position(axis.AxisId, 0); } else { MessageBox.Show("Axis is Not Ready or occur EMG Stop !"); } } else { MessageBox.Show("Axis Parameters of AcclerateVelocity is Incorrect !"); } }