Hello,
The code you previously provided for loading a .pgf program now works and reports Load request succeeded. However, starting the program using API.RAPID.startExecution() usually fails with either FailedToSetPPToRoutine or FailedToResetPP.
There was one occasion when the complete sequence worked: I switched the Wizard’s Edit program setting to On, then pressed the GEJDBALKAR button in the Operator Panel. The program loaded and started successfully, and the FlexPendant displayed “Please push operator ready”. On the next attempt, the error FailedToSetPPToRoutine occurred again. I have not been able to reproduce the successful result consistently, so I do not know whether enabling Edit program was the reason it worked.
The loaded program is Gejdbalkar_tappar.pgf, located in:
$HOME/Programs/Gejdbalkar_tappar/Gejdbalkar_tappar.pgf
The program contains Wizard → main, and the program pointer is positioned at the InitEAW instruction.
InitEAW belongs to Axson Teknik AB’s EasyAutoWelder (EAW) application, not ABB’s standard RAPID functionality. It displays “Please push operator ready” and waits for the operator to press a physical Operator Ready button before the welding sequence continues. It also includes other safety features. I tried removing the InitEAW instruction to see whether it was causing the problem, but the same error persisted.
The intended behaviour is for the operator to press the GEJDBALKAR button on the AppStudio Operator Panel. This should load the selected .pgf program and start execution until it reaches InitEAW, where it waits for the physical Operator Ready button.
What I have observed
-
The .pgf loading code works and reports Load request succeeded.
-
Starting the program manually from the FlexPendant works and displays “Please push operator ready”.
-
On one occasion, the Operator Panel successfully loaded and started the program after I switched Edit program to On. On subsequent attempts, the start failed again.
-
The errors encountered include FailedToSetPPToRoutine and FailedToResetPP.
-
The controller event log shows program load, program start, and program stop events. The stop event reports that task T_ROB1 was aborted because the RESET or POWER_ON event routine completed.
-
The program is stopped when I press the Operator Panel button.
I have tried API.RAPID.startExecution() with moduleName: "Wizard", procName: "main", setPP: true, and also without specifying the module and procedure. I have also tried calling API.RAPID.setPPToMain() and API.RAPID.setPPToRoutine() separately. These attempts have not resolved the issue consistently.
Current code in the button’s onClick handler
This is the current code in GEJDBALKAR → Behavior → onClick:
const programFolderName = "Gejdbalkar_tappar";
const programName = "Gejdbalkar_tappar.pgf";
const path =
`$HOME/Programs/${programFolderName}/${programName}`;
const body =
"progpath=" + encodeURIComponent(path) +
"&loadmode=replace";
try {
await API.RWS.requestMastership("edit");
try {
await RWS.Network.post(
"/rw/rapid/tasks/T_ROB1/program/load",
body
);
} finally {
await API.RWS.releaseMastership("edit");
}
await API.RAPID.startExecution({
cycleMode: "once",
taskName: "T_ROB1"
});
TComponents.Popup_A.info(
"Program loaded and start requested"
);
} catch (error) {
TComponents.Popup_A.info(
"Error: " + String(error)
);
}
Current code in the Function section
I also have a separate function named Select_Gejdbalkar:
const Select_Gejdbalkar = async () => {
const programFolderName = "Gejdbalkar_tappar";
const programName = "Gejdbalkar_tappar.pgf";
const path =
`$HOME/Programs/${programFolderName}/${programName}`;
const body =
"progpath=" + encodeURIComponent(path) +
"&loadmode=replace";
try {
await API.RWS.requestMastership("edit");
try {
await RWS.Network.post(
"/rw/rapid/tasks/T_ROB1/program/load",
body
);
} finally {
await API.RWS.releaseMastership("edit");
}
TComponents.Popup_A.info("Load request succeeded");
} catch (error) {
console.error("Load failed:", error);
}
};
export default Select_Gejdbalkar;
The Function version only loads the program; it does not start RAPID execution. The loading code is currently duplicated directly in onClick.
When I previously tried calling Select_Gejdbalkar() from onClick, the result was Select_Gejdbalkar is not defined, so I moved the loading code directly into the handler.
Could you please review both code sections and perhaps provide a working example for loading the .pgf program and starting its main procedure reliably? I would also appreciate your advice on whether the loading code should be placed in the Function section or directly in the button’s onClick handler.
Thank you for your help!