Nesting for the method Call

  • Hi everyone.


    I'm just starting to learn how to program Fanuc robots, and for general understanding, I would like to ask a few simple questions.


    We have Main program, in which we can call subprograms and macros (and something else). Inside each subprogram we can embed a call to our subprogram, and inside this subprogram we can embed more subprograms. etc


    Where is the limit of this nesting?


    Also, can I call 2 subprograms at the same time? And the 10 subprograms? And 100 routines called at the same time? Where is the limit of multithreading?


    I will be grateful for the answer :)

  • MOM

    Approved the thread.
    • Helpful

    You can do a reasonable amount of nesting, in the ballpark of 100, not that you'd ever need to. I believe that is only limited by stack memory. The only time I've seen it become a problem is an unintended recursive call causing a stack overflow.


    I believe there is a more concrete limit to multithreading with the run command. I'd have to look up the manual but the number 4 sticks in my head. You can also have several BG programs and an autoexec program. So also very reasonable. Only 1 thread can have motion control of a given motion group at a time.


    Honestly, with BG Logic, there is little need to multithread with the run command. I would do any background logic only tasks in a BG Logic program and only use Run for vision or multiple motion groups.

  • Agree to HawkME, the multi-tasks is 4 by default.

    Could be upgrade in system variable (or controlled start config), but could have some impact on BGL refresh time.

    If it starts well the first time, you have not checked all !

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now