# Set Program Pointer

**URL:** <https://tech-community.robotics.abb.com/t/set-program-pointer/3487>\
**Category:** Developer Tools\
**Created:** [April 2, 2010, 9:35am UTC](https://tech-community.robotics.abb.com/t/set-program-pointer/3487 "2010-04-02T09:35:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KSP](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@KSP](https://tech-community.robotics.abb.com/u/KSP)\
**Post date:** [April 2, 2010, 9:35am UTC](https://tech-community.robotics.abb.com/t/set-program-pointer/3487/1 "2010-04-02T09:35:10Z")

</div>

I have a problem with setting the Program Pointer to a given routine.  
I have 2 tasks defined in the controller (T\_ROB1 and T\_ROB2) with each task  
having it’s own program with a number of routines.  
What I want, is to start a task at a given routine. So first I set the PP to the routine using the Task.SetProgramPointer() funtion and then I start the task.  
This works fine, but when I want to start the second task in the same way I get an error (Operation is illegal in current execution state) when setting the PP. I think it is because the other task is running.

Is there any way to work around this problem or is it just not possible to set the PP of one task when another task is already running?!
