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.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings