Forum Migration Notice
We're transitioning to a more modern community platform by the end of this year. Learn about the upcoming changes and what to expect.
How to restart VC via PC SDK?
Saibel
✭
Hi!
I try to call Controller.Restart() method and get en exception telling me that I don't have a right controller mastership. I have tried with mastership on configuration and on RAPID, no one is enough, so I just give up now and kindly ask you about a couple of C# rows to restart it.
Thank you!
Best regards,
Sergej Saibel
Sergej Saibel
0
Comments
-
Hello Sergej,Please try following code- Its working for me- PC SDK 5.12
class Program
{
static void Main(string[] args)
{Guid ctr_id=new Guid("b4108096-c905-4a47-8c09-64bd84c84161");
ControllerInfo cinfo=new ControllerInfo(ctr_id);
Controller _ctr = new Controller(cinfo);
try{ _ctr.Logon(UserInfo.DefaultUser);
using (Mastership.Request(_ctr.Rapid))
using (Mastership.Request(_ctr.Configuration))
_ctr.Restart(ControllerStartMode.Warm);
}
catch(System.Exception Exception)
{
Console.WriteLine(Exception.Message);
}
}
}Regards
Saleem Javed0 -
Hi! Thank you very much! It works!Best regards,
Sergej Saibel0
Categories
- All Categories
- 5.6K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 15 RobotApps
- 306 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.9K Robot Controller
- 365 IRC5
- 84 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 854 RAPID Programming
- 37 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 110 Collaborative Robots
- 5 Job listings