RobotStudio event

Turning Motors on and off

Hi, I'm a newbie to PC SDK and I'm working on an application that requires being the ability to turn the motors on or off.  I'm using PC SDK version 5.11. Is there a method, either directly or through RAPID, to turn the motors on or off?

Comments

  • It's easy 
    In my case, I use Visual studio C# to do my application. And there is a button event to turn on or off 

    private Controller mycontroller = null;

    private void button_Click(object sender, EventArgs e)
            {
                    if (mycontroller.State == ABB.Robotics.Controllers.ControllerState.MotorsOn)
                    {
                        mycontroller.State = ABB.Robotics.Controllers.ControllerState.MotorsOff;
                    }
                    else
                    {
                        mycontroller.State = ABB.Robotics.Controllers.ControllerState.MotorsOn;
                    }
            }

    then done.