System Failure during StartLoad

Hello,
In my application, I have a mainmodule that calls several sub modules. I want to load the second sub module (Prg_2.mod) in background while first sub module (Prg_1.mod) is executing, so that when the first module is done executing, I want the second sub module to start immediately. For this, I tried using Load \Dynamic and StartLoad methods.
However, as soon as controller starts executing StartLoad command, it goes into system failure with error saying not enough memory. All my sub modules are limited to 30000 lines and have similiar number of target points. The file size of the sub modules are about 5.8 MB each.
I checked the available RAPID memory and it is about 28 MB. Is there a way to overcome the system failure and achieve background loading of sub modules?
In my application, I have a mainmodule that calls several sub modules. I want to load the second sub module (Prg_2.mod) in background while first sub module (Prg_1.mod) is executing, so that when the first module is done executing, I want the second sub module to start immediately. For this, I tried using Load \Dynamic and StartLoad methods.
TPWrite "Step-3: Loading subprogram 1"; modulepath_1 := "/hd0a/05-102441/HOME/R3DP/Prg_1.mod"; Load \Dynamic, modulepath_1; modulepath_2 := "/hd0a/05-102441/HOME/R3DP/Prg_2.mod"; StartLoad modulepath_2, load_2;
However, as soon as controller starts executing StartLoad command, it goes into system failure with error saying not enough memory. All my sub modules are limited to 30000 lines and have similiar number of target points. The file size of the sub modules are about 5.8 MB each.
I checked the available RAPID memory and it is about 28 MB. Is there a way to overcome the system failure and achieve background loading of sub modules?
Comments
2. Is there a way to preload the targets?
"Because of power fail in executed Load or StartLoad...WaitLoad instruction, the RAPID program memory is inconsistent.
**TO REPAIR DO P-START**
Recommended Actions
Important to do P-start, because the RAPID program memory is destroyed:
-Faulty init value of PERS variables
-Reduction of the available program memory size"
Keep in mind that a P-START deletes all RAPID program modules, so make sure you make a backup before proceeding.
Now everything is back and running, is there a solution for increasing RAPID memory without any hardware changes? or preload targets?
The first instruction is Load so that the program execution waits for first sub module Prg_1.mod to be loaded into the controller memory. After this I have StartLoad to begin loading of second sub module Prg_2.mod. I have a corresponding WaitLoad later in the program when execution of first module is completed.
Isn't WaitLoad have to be used with StartLoad only and can't be used with regular Load?
Is there a way to increase overall RAPID memory in the IRC5 controller?
You will have to break the program into smaller modules.