Custom M-Code (Python)

More
7 years 3 months ago #139654 by andypugh
Replied by andypugh on topic Custom M-Code (Python)
It looks like something deep down in the code is not getting a parameter it expects,

Does the error occur when you try to run the remaps, or when you start the config?

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #139662 by TheBigLebowski
The INI file runs fine and brings up pathpilot as it should.

The error comes up when I attempt to run the Gcode through the mdi in Pathpilot, so it is happening somewhere in the remaps.

The last called routine is shown as Remap > (pycall(m11) > TK GUI

So either the List from the previous gcode (pycall(m10)) is being lost, or it cant find the TK file. My guess would be on the former.

To verify I think i can try to bring up the TK GUI without carrying any data to it. If it works that would point towards the previous list info being lost / mishandled.
Code:
14:17:58 | pycall(m11): Traceback (most recent call last): File "python/remap.py", line 395, in m11 dialog = Tk() File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1762, in __init__ baseName = os.path.basename(sys.argv[0]) IndexError: list index out

Please Log in or Create an account to join the conversation.

More
7 years 3 months ago #139717 by Todd Zuercher
I don't know much of anything about Pathpilot. But it looks like it comes with some G-code remapping already. So you have to modify Andy's install instructions by only adding your new M-codes to the list of remapped codes Tormach already has in the ini file and adding the appropriate lines to Tormach's already existing remap.py file. If you tried adding a 2nd remap.py file, I don't think that will work.

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #168419 by spacemanspiffee
Did you ever get this working? I'm starting down this rabbit hole and am running into the same error you have here.

Any help would be much appreciated.

Please Log in or Create an account to join the conversation.

More
6 years 4 months ago #173017 by TheBigLebowski
I never did get this working. I have since bought a new machine (fadal) and use its built in variables to do what i wanted

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #238003 by Thom
Replied by Thom on topic Custom M-Code (Python)

If your code is part of a remap then you _can_ import emccanon. I have never figured out what the magic is to do it outside of a remap.
So, rather than a custom M-code in the M100-M199 range, you can remap another code of your choice, and then it will (probably) be easier.

Hi are there any news?
Could not find anything about this topic..
Is the emccanon access possible from an other python script (like Python Hal Component)

Best regards,
Thomas

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum