/// <summary> /// Same as Clear Alarm /// </summary> /// <param name="mc"></param> private void OnReset(SMMethodCall mc) { string ret = ""; SendCommand("STOP"); ret = WaitForCommand(); CheckOKReplied("STOP", ret); SendCommand("MANUAL"); ret = WaitForCommand(); CheckOKReplied("MANUAL", ret); SendCommand("EMGRST"); ret = WaitForCommand(); CheckOKReplied("EMGRST", ret); SendCommand("AUTO"); ret = WaitForCommand(); CheckOKReplied("AUTO", ret); SendCommand("RESET"); ret = WaitForCommand(); CheckOKReplied("RESET", ret); SendCommand("RUN"); ret = WaitForCommand(); CheckOKReplied("RUN", ret); mc.End(); }
private void OnSetDecel(SMMethodCall mc, Axis.AxisBase axis, double decel) { int axisNumber = axis.Id + 1; double percent = GetPercentage(axis, "Default Decel", decel); SendCommand(string.Format("DECEL({0})={1:F2}", axisNumber, percent)); string ret = WaitForCommand(); CheckOKReplied("SetDec", ret); mc.End(); }
private void OnHome(SMMethodCall mc, Axis.AxisBase axis) { // If Incremental //SendCommand(string.Format("ORGORD({0})", axisNumber)); SendCommand(string.Format("ABSRST")); string ret = WaitForCommand(); CheckOKReplied("WaitHomeDone", ret); mc.End(); }
/// <summary> /// Make Contoured move /// </summary> /// <param name="mc"></param> /// <param name="axes"></param> /// <param name="positions"></param> /// <param name="speed"></param> private void OnMoveContoured(SMMethodCall mc, Axis.Axes axes, double[] positions, double speed) { double percent = GetPercentage(this, "Default Vector Speed", speed); double pos1 = U.ConvertFromInternal(Enums.UnitTypes.mm, positions[0]); double pos2 = U.ConvertFromInternal(Enums.UnitTypes.mm, positions[1]); SendCommand(string.Format("DRIVE({0},{1:F2}),({2},{3:F2}),S={4:F2}", 1, pos1, 2, pos2, percent)); string ret = WaitForCommand(); CheckOKReplied("WaitVectorMoveDone", ret); mc.End(); }
// Single Axis move commands /// <summary> /// Move single axis in Relative /// </summary> /// <param name="mc"></param> /// <param name="axis"></param> /// <param name="dPos"></param> /// <param name="dSpeed"></param> private void OnMoveSingleAxisRel(SMMethodCall mc, Axis.AxisBase axis, double dPos, double dSpeed) { int axisNumber = axis.Id + 1; double percent = GetPercentage(axis, "Default Speed", dSpeed); dPos = U.ConvertFromInternal(Enums.UnitTypes.mm, dPos); SendCommand(string.Format("DRIVEI({0},{1:F2}),S={2:F2}", axisNumber, dPos, percent)); string ret = WaitForCommand(); CheckOKReplied("WaitMoveDone", ret); mc.End(); }
private void OnEnableAxis(SMMethodCall mc, Axis.AxisBase axis, bool bEnable) { string ret = string.Empty; int axisNumber = axis.Id + 1; if (bEnable) { SendCommand(string.Format("SERVO ON({0})", axisNumber)); ret = WaitForCommand(); CheckOKReplied("Enable", ret); } else { SendCommand(string.Format("SERVO FREE({0})", axisNumber)); ret = WaitForCommand(); CheckOKReplied("Enable", ret); } axis.Enabled = bEnable; mc.End(); }
private void OnSendCommand(SMMethodCall mc, string strCmd) { SendCommand(strCmd); dsResponse.Val = WaitForCommand(); mc.End(); }