Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- if (controller.OperatingMode == ControllerOperatingMode.Auto)
- {
- tasks = controller.Rapid.GetTasks();
- using (Mastership m = Mastership.Request(controller.Rapid))
- {
- //Perform operation
- tasks[0].Stop(0);
- controller.Rapid.Stop(ABB.Robotics.Controllers.RapidDomain.StopMode.Immediate);
- }
- }
- else
- {
- MessageBox.Show("Automatic mode is required to stop execution from a remote client.");
- }
- }
- catch (System.InvalidOperationException ex)
- {
- MessageBox.Show("Mastership is held by another client." + ex.Message);
- }
- catch (System.Exception ex)
- {
- MessageBox.Show("Unexpected error occurred: " + ex.Message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement