Example #1
0
        /// <summary>
        /// Evaluates the stop condition, checking for EStop or a limit switch. Turns off all devices and sets an error message to be returned.
        /// </summary>
        private string GetEStopErrorMessage()
        {
            string limitSwitch;

            if (Program.OvertravelCondition)
            {
                if (AxisX.IsAtLimit(out limitSwitch))
                {
                    return("***E-STOP Activated: X Axis (" + limitSwitch + ") Limit reached");
                }
                if (AxisY.IsAtLimit(out limitSwitch))
                {
                    return("***E-STOP Activated: Y Axis (" + limitSwitch + ") Limit reached");
                }
                if (AxisZ.IsAtLimit(out limitSwitch))
                {
                    return("***E-STOP Activated: Z Axis (" + limitSwitch + ") Limit reached");
                }
            }

            if (Program.EStopCondition)
            {
                return("***E-STOP Activated");
            }

            return("Unknown reason for motion stop condition");
        }