Stop and Pp-to-main one robot on a 2-robot-single-controller system

Hello,

I have two robots connected to one controller.

There are 2 system input to “start_at_main” each robot.

I want to stop robot 1 and send PP to main without stopping robot 2.

Right now I’m using two Di to throw interrupts and stop each robot independently. Inside the trap routine I stop the corresponding robot. Yet it seems I cannot “start at main” with system input; it says “start at main rejected”; task must be in stop; but I’m sure I’m calling “Stop” within the trap routine; do both robots need to be stopped in order to PP_to_main only one of them? Can I send “Start at main” from within trap? What’s the best way to Stop only one robot and be able to send its PP to main? Maybe a ExitCycle and forget system “Start at main”?

Also, one of the robots’ main routine is just reading an AI and call a program with that name (with call by name); Is there a way to return from that called routine whenever a given Di is set? My PLC tells me which program to run but also needs to tell me to abort that program. Any straightforward way of doing this?

Thanks in advance,

Best regards

Use system input “PP to Main” instead of “Start at Main”. You can specify in the argument which task you want to PP-to-main.

“start at main rejected”: this is because the other task is still running. Using system input PP-to-Main as my comment above should be OK.

Not so sure what you’re trying to do here. Send us some code so it’s clearer.

Maybe you can use a trap routine that execute exitcycle. Don’t know if that will work?