First of all, thank you to this community for existing; you can't imagine how many times you give us valuable tips and advice!!!
We had exactly the same problem with online modification; our controller (SLC 552) was pretty far to be full and the message : Program could not be compiled!.... appeared everytime. We tried every advices find here and in techconnect, but nothing worked. At this moment, the only way we found to add new rungs has been to delete some useless rungs and then, we have been able to add the new rungs.
However, we had to add more rungs and the same problem come back. Because we saw the the controller could be the problem, my colleague tried to add the rungs offline and the same problem happened, so we were pretty sure that the problem was not from the CPU. Then, he tried to add the new rungs in another ladder and BINGO, it worked!
So the question is; we knew that there is a maximum of instruction that we can use in a rung, but is it possible that there is a maximum of instructions possible in a ladder?
We use a SLC 552, we still have 3800 instructions left and our principal ladder has 1454 rungs with a lot of multiple branch with PID, CMP, SCP, RTO, etc to runs our process. It is an old factory that we add to many things since, we are in process to change the CPU in the next years.