How to restart VC via PC SDK?
Options
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.4K RobotStudio
- 381 UpFeed
- 14 Tutorials
- 12 RobotApps
- 291 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 247 ScreenMaker
- 2.7K Robot Controller
- 279 IRC5
- 46 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 737 RAPID Programming
- 15 Wizard Easy Programming
- 105 Collaborative Robots
- 3 Job listings