Rapid code execution

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

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.

Hello,

Thank very much for your reply.

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

Thanks a lot for your information.