REMAP=M6 modalgroup=6 python=atc_toolchange

More
1 year 3 weeks ago #336067 by Doc_emmet
Hello, I'm trying to run a Python file with REMAP=M6 modalgroup=6 python=atc_toolchange, but when I start Linuxcnc, I get the message: Hard Limits Are Reset To Active! The Python file doesn't say what could be causing this. Does anyone have an example of how I can run a Python file with REMAP=M6?

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

More
1 year 3 weeks ago #336100 by Aciera
I think that is just a GUI message (qtDragon?). What makes you think it is due to your remap?

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

More
1 year 3 weeks ago - 1 year 3 weeks ago #336110 by Doc_emmet
Hello, yes QtDragon, Linuxcnc is running without any problems. However, as soon as I insert the line REMAP=M6 modalgroup=6 python=atc_toolchange, Linuxcnc starts with a significant delay, then displays the error message "Hard Limits Are Reset To Active!" and I can't even use it. I call this test program with M6:

import linuxcnc
import time

def atc_toolchange(**words):

s = linuxcnc.stat()

if not all(axis.homed for axis in s.axis[:3]): # XYZ
return linuxcnc.INTERP_OK

c = linuxcnc.command()
c.mdi("G53 G0 Z100")

while s.interp_state != linuxcnc.INTERP_IDLE:
s.poll()
time.sleep(0.05)

return linuxcnc.INTERP_OK

Thank you very much for your effort.
Last edit: 1 year 3 weeks ago by Doc_emmet.

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

More
1 year 3 weeks ago - 1 year 3 weeks ago #336113 by Aciera
Have you started your config from a terminal to check for errors in the terminal output?

Code:
$ linuxcnc


Also some of your remap code looks a bit odd (eg. 'linuxcnc.INTERP_OK)
You might want to have a look at some examples:
github.com/LinuxCNC/linuxcnc/blob/master...rted/python/remap.py
Last edit: 1 year 3 weeks ago by Aciera.

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

More
1 year 3 weeks ago #336119 by Doc_emmet
this is my new test file remap_m6:

#!/usr/bin/env python3
from interpreter import INTERP_OK, INTERP_EXECUTE_FINISH, INTERP_ERROR

print(">>> remap_m6.py wird geladen <<<")

def remap_m6(self, **words):
try:
tool_number = words.get('t', 1)
print(f">>> M6 Werkzeugwechsel aufgerufen: T{tool_number} <<<")
# Sofort fertig melden
yield INTERP_EXECUTE_FINISH
except Exception as e:
print("Fehler in remap_m6:", e)
yield INTERP_ERROR

yield INTERP_OK

But this is supposedly not executable?

'remap_m6' is not a Python callable function - 49:REMAP = M6 modalgroup=6 python=remap_m6

I've already made some Python scripts that work, so why is it so different when called with M6?

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

More
1 year 3 weeks ago #336124 by Doc_emmet
Can you create a small Python file (as simple as possible) that when I call it via REMAP = M6 modalgroup=6 python=remap_m6 , for example, only moves the Z-axis by 10mm

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

Time to create page: 0.258 seconds
Powered by Kunena Forum