RobotStudio event

Pc SDK setting program pointer

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;
}
}
}
 
 

Comments

  • In PC SDK there is a section "Using the pc sdk". Under that section there is a topic "creating a simple pc sdk application". In that topic you can find the codes to start a rapid code. You can modify it to change the program pointer


  • Hey mate, thank you for replying.

    Any idea what the exact modification is?
     

    i have read the entire PC SDK "getting started "manual, i have been programing it to do other things.

     

    I have tried to modify the code to change the program pointer, i have found reset the program pointer but could not find how to set the pointer.

     

    Do you know the code?