Subprogram skips out of Main and shows Errors INTP-105 and MCTL-105

  • Hello everyone,


    The situation is this:

    I have created a main program. In that program I call 2 different programs for different working areas (left and right).

    In those programs, there are sub -programs, makros and etc.


    While running the Main program in Manual T1/T2 (step mode) sometimes about 30 cycles or less, during running some subprograms, they skip out of Main program and it completely abort the Main, so the robot stays in the subprogram. When that happens it shows Error INTP-105 and MCTL-003 errors, but after i checked them in the Fanuc Alarm PDF - they don't say much. Only reset errors and continue. The only way to continue is after reset, to abort the subroutine and manually choose Main program, get back on the same place in the program and it continues like nothing happened without any errors.


    It looks like a buffer or Memory which cannot hold so many processes and needs to be reset. But this is not good for Automatic mode, obviously.


    Please, if you have knowledge of this, let me know.


    Regards

  • It it was a memory issue, then id expect there to be a stack overflow error. That would generally be caused if you are accidentally using recursion, where a program ends up calling itself, maybe indirectly.


    I would need you to post or send your programs to see the issue.

  • Ok, so here they are. They are very long, but i gave few explanations in between to get a better picture.


    Don't mind the names, I was trying PNS program start method for testing, that is why. This is the Main program, which is selected with OTHER start method. From there I call program number 1 (line 43)


    This is program no 1, here I call all subprograms, movements of the robot. For the moment the only active programs are from line 53, 3 programs.



    The working program Buxematrix on line 59 is where it all starts.


    Inside this program Buxematrix, I call subprograms (starting line 31 to 72) which do something and then go back to this program. That is where I get my error, in one of those programs, randomly after some time.


    In the end of previous program on line 120 i call another program (Buxeintraverse) from which when it ends calls back the program Buxematrix (Line 817). They go back and forth, until all conditions are satisfied, so in the end jump back to program number 1.

  • This is the one of the programs from line 31 to 72 in Buxematrix where i get the errors.



    And this is the program Buxeintraverse from where i call back the working program Buxeinmatrix on line 817, so they go back and forth. I cut several hundred lines of code to be able to post it.


  • Delete line 81 on PNS0001. That is a bad recursive call.


    You should never call a parent program from a sub program. When the sub ends it will automatically return to the parent.


    You will need to address where it returns in the main program on line 44. You should also delete line 48 in your main to prevent it going home without the UF and UT set correctly. Since it jumps back to lbl 1 it will do that anyway.

  • Thanks HawkMe. I understood all points except this one. In line 44 of the main program I have ENDIF. I don't understand what do you mean - to address where it returns.


    You will need to address where it returns in the main program on line 44.

    Is it possible for you to check the rest of the code, in the working program Buxenmatrix, since the problems were actually there while testing? Or maybe these solutions that you gave me will do the job. Anyways, I cannot test any of these until Monday so I will let you know how it is going. Again, thanks.

  • I meant since you were never allowing the program to end it would never execute any code below that line. Now that it is, the behavior will be different so you have to make sure it works properly. By deleting the last move home it should take care of that.


    You mention that your other 2 programs call each other back and forth. You can't do that. It's unnecessary anyway and will just cause your program to error out over time. When a called program ends it returns back to the caller to continue on.


    If you need to do those 2 functions repeatedly then you need to call them 1 at a time from a parent program. Then use a jump label to repeat. You have to let each called program come to a complete end before you call it again otherwise you just keep stacking programs in memory, leading to a stack overflow.

Advertising from our partners