RobotStudio event

Remote program Loading

We are using PC SDK 5.10. We are making tests on robot having both release 5.10 and 5.09.

The program is transferred into a folder on robot controller, after the actual program is deleted and the new one is loaded. We must insert some delays between the operations because without them the loading was not successful.


Here are the steps.
aController.Rapid.GetTask(tname).DeleteProgram();
Thread.Sleep(ABBDelay);
Task aTask = aController.Rapid.GetTask(tname);
aTask.LoadProgramFromFile(
"(HOME)$/" + robotCode + "/" + robotCode + ".pgf", RapidLoadMode.Add);
Thread.Sleep(ABBDelay);

aTask.ResetProgramPointer();
The remaining problem is:
afetr loading, there are 3 random results:
1. Always OK
2. Error in resetting program pointer (message in the production window)
3. Always OK, but the program name is not present into the production window.
In cases 2 and 3 if I manually enter the Editor window I can read the program complete of the name. After I return into the production window and all is OK.
The problem seems to be something like a "refresh" problem, but I am not able to fix it.
I need your suggestion.
PS: I try also to load the program using the Replcae switch without deleting the old one but the procedure cannot be executed (error loading the program)
Best regards,
Davide
Davide