Advanced Tips

Subroutine and Macro call efficiency

G-code syntax does not provide subroutine forward declarations, therefore when the interpreter finds a subroutine call, it should check if the subroutine is defined in the file, and if it is not it looks for an external subprogram with the appropriate name.
This approach can take time if the file where the subroutine call is placed is long, but there are some tips to write a more efficient G-code: