Hello
I am using PC SDK with visual basic to try and select a routine, and run it.
I would like to set the program pointer at the start of the routine.
I have found this example for c# but i cannot get it working for VB
any help or guidance will be greatly appreciated ![]()
thank you
Daniel
This example sets the program pointer to the routine “DoProcessService” in “MainModule”.
**using** ABB.Robotics;
**using** ABB.Robotics.Controllers;
**using** ABB.Robotics.Controllers.RapidDomain;
...
**try**
{
Controller controller = **new** Controller();
Task[] tasks = c.Rapid.GetTasks();
Mastership master;
**if** (controller.OperatingMode == ControllerOperatingMode.Auto)
{
**using** (master = Mastership.Request(controller.Rapid))
{
tasks[0].SetProgramPointer("MainModule", "DoProcessService");
}
}
**else**
{
MessageBox.Show("Setting the program pointer is not allowed in manual mode from a remote client.");
}
}
**catch** (System.InvalidOperationException ex)
{
MessageBox.Show("Mastership is held by another client.");
}
**catch** (System.Exception ex)
{
*//TODO: Add error handling*
}
**finally**
{
*//must release mastership in case an error occurred when SetProgramPointer was executed*
**if** (master != **null**)
{
master.Dispose();
master = **null**;
}
}
}