instructions error

Need help.

instructions error
Description
TASK T_ROB1: variable and trap routine already connected

Actions
It is not legal to connect a specific variable with a trap routine more than once

I feel i must write an error handler but i m not so experienced in RAPID programming. It is needed to automatically restart execution of processes.
Programm looks like (simple)

MODULE module1
workobjectdata …
targetsdata …
tooldata…
speeddata…

PROC main()
path1;
path2;
END PROC

PROC path1()
move instructions …
END PROC

PROC path2()
move instructions…
END PROC

END MODULE

after execution of path1 and path2 i get the error i v mentioned above and i have to manually press ok to the error message, PP to main and start button. ANy advice how to automate this?
Thx.

Hi Dimitri,

Do you have any intnum variable in your program.

VAR intnum nVaribale;

If you have one try to delete it at the end or begining of each cycle with IDelete command.

IDelete nVaribale;

BR.

Lol. this was simple)
I have just to insert proccall (to main proc) at the end

MODULE module1
workobjectdata …
targetsdata …
tooldata…
speeddata…

PROC main()
path1;
path2;
END PROC

PROC path1()
move instructions …
END PROC

PROC path2()
move instructions…
main;
END PROC

END MODULE

So now i have endless cycle and operator must press stop manually to stop robot ;p

Greetings,

This solution is not so good. It will cause a execution stack overflow. It is recursive; your call heirarchy has already started in the main and then you call main from within. A better solution for an infinite loop would be: WHILE (TRUE) DO
Proc1;
Proc2;
ENDWHILE

BR,

or if you wanted some control over it. You can set the robot to run in continous cycle instead of single execution and when it finished main it will start again.