Hello everyone,
I recently came across an interesting RAPID program where MAIN is called from a subroutine, which made me curious about how long this approach can run. In the usual structure, a robot completes a subroutine and returns to the routine that originally called it. But in this example, it seems like the subroutine rountine1 calls MAIN again, creating a sort of loop between the two routines. Here’s a simplified version of the code I saw:
PROC Main()
WaitTime 0.5;
rountine1;
ENDPROC
PROC rountine1()
WaitTime 0.5;
Main;
ENDPROC
My main questions are:
- Is this a valid approach in RAPID? I wonder if continuously calling MAIN from rountine1 could lead to stack overflow or memory issues over time.
- Will the robot “remember” to start from MAIN after hours of running this loop? In other words, how does the robot manage memory and subroutine calls over an extended period?
Would love to hear any insights or experiences on this topic! Thanks in advance.