# Rapid code execution

**URL:** <https://tech-community.robotics.abb.com/t/rapid-code-execution/2712>\
**Category:** Developer Tools\
**Created:** [April 24, 2009, 5:34pm UTC](https://tech-community.robotics.abb.com/t/rapid-code-execution/2712 "2009-04-24T17:34:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newform](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@newform](https://tech-community.robotics.abb.com/u/newform)\
**Post date:** [April 24, 2009, 5:34pm UTC](https://tech-community.robotics.abb.com/t/rapid-code-execution/2712/1 "2009-04-24T17:34:51Z")

</div>

Dear All,

I am developing a windows application using PC SDK and VS2005. I want to remotely start a Rapid program. What I did is

1. get controller handler and check its operation mode
2. get mastership
3. get task
4. start the task by invoking, say “StartResult result = Task[0].Start()”

The return value of this function is “StartResult.error”. There is no any clue about what is wrong.

Can anybody provide any hint? Many thanks

---

<div class="post-metadata">

**Author:** ![RussD](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@RussD](https://tech-community.robotics.abb.com/u/RussD)\
**Post date:** [April 24, 2009, 6:37pm UTC](https://tech-community.robotics.abb.com/t/rapid-code-execution/2712/2 "2009-04-24T18:37:56Z")

</div>

You would need to be in auto, have a program pointer, have the motors on before this would work. You might consider using System Inputs and outputs, like a PLC would use, to try to implement your program control, it might be simpler and more straight-forward than doing it all programmatically.

---

<div class="post-metadata">

**Author:** ![newform](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@newform](https://tech-community.robotics.abb.com/u/newform)\
**Post date:** [April 24, 2009, 7:12pm UTC](https://tech-community.robotics.abb.com/t/rapid-code-execution/2712/3 "2009-04-24T19:12:17Z")

</div>

Hello,

Thank very much for your reply.

I just added one more function Task.ResetProgramPointer(). It works.

Thanks a lot for your information.
