Remap M6 Prolog & Epilog question

More
1 year 8 months ago #320521 by Sziggy_NC
I am attempting to setup a standard carousel style atc.

In my INI my RS274NGC is as follows:

[RS274NGC]
PARAMETER_FILE = parameters.var
SUBROUTINE_PATH = /home/sabre/linuxcnc/configs/sabre_500_mesa_7i97t/subroutines/
REMAP= M6 modalgroup=6 prolog=change_prolog ngc=Tool_change_sub epilog=change_epilog

Does this mean that I need a file named change_prolog.py and change_epilog.py saved in the subroutines path? (I see the change_prolog & change_epilog sections in the stdglue.py)

Currently I have stdglue.py and tool_change_sub.ngc in the subroutine path and I get pycall(remap.change_prolog)failed on a tool change.

I have been reading the Remap Extending G-Code, and I don't see where or how I should save the prolog and epilog.

Please Log in to join the conversation.

More
1 year 8 months ago #320522 by spumco
Create a subfolder in your config folder named 'python.'

Put remap.py, stdglue.py, and toplevel.py in the new 'python' folder.

An example can be found here:
github.com/LinuxCNC/linuxcnc/tree/master...ython-stdglue/python

The change_prolog & epilog stuff are contained within the stdglue.py file.  What the "REMAP=" statement in the INI file is doing is telling LCNC:
  • When LCNC sees and "M6"
    • Look at toplevel.py and import (use) everything in remap.py
    • Look at remap.py (import stdglue.py)
Look at stdglue.py and substitute all the "change_prolog"  and "change_epilog" sections for LCNC's built-in behavior

And the ngc=Tool_change_sub section is telling LCNC to substitute that file (i.e. do whatever is in the file) for LCNC's built-in behavior.

EDIT-

Forgot to add... you also need a [PYTHON] section in your INI file if you don't already have one.  That 'TOPLEVEL=' part tells LCNC where to start looking for everything.

[PYTHON]
PATH_PREPEND = python
TOPLEVEL = /your config folder name here/python/toplevel.py
PATH_APPEND = /your config folder name here/python/

Please Log in to join the conversation.

More
1 year 8 months ago #320523 by spumco

Please Log in to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum