REMAP M6 weird issue

More
16 Oct 2022 20:49 #254258 by ddB0515
REMAP M6 weird issue was created by ddB0515
Hello all

So I have LinuxCNC 2.9 (master) on Debian 11 with probe_basic and everything works fine
As I have build rack tool changer trying to get M6 remap to work so I can do my ATC routines to be able to change tools

I have added to ini next:
[PYTHON]
TOPLEVEL = ./python/toplevel.py
PATH_APPEND = ./python/
PATH_APPEND = ./python/python-stdglue/
# LOG_LEVEL = 10

toplevel.py 
import remap

remap.py
from stdglue import *

and python-stdglue folder copied from
/usr/share/linuxcnc/ncfiles/remap_lib

Also added to [RS274NGC]
REMAP=M6 modalgroup=6 prolog=change_prolog ngc=rack_change epilog=change_epilog

I have created simple rack_change.ngc to test if will work
o<rack_change> sub
(print, Start of Program)
(print, in change tool_in_spindle=#<tool_in_spindle> current_pocket=#<current_pocket>)
(print, selected_tool=#<selected_tool> selected_pocket=#<selected_pocket>)
;otherwise after the M6 this information is gone!
#<tool> = #<selected_tool>
#<pocket> = #<selected_pocket>
;first go up
G53 G0 Z0
; then move to 1st pocket position
G53 G0 X5 Y72
(print, End of Program)
o<rack_change> endsub [1]
M2

This is not DONE script and this is only to get it up and running but after I call M6 T2 (or any other tool) I get just this in output and my machine is not moving (so no movement on any axis)
[qtpyvcp.actions.machine_actions][INFO]  Issuing MDI command: M6 T2 (machine_actions.py:208)
emcTaskPlanLevel() returned 0
 Start of Program
 in change tool_in_spindle=0.000000 current_pocket=0.000000
 selected_tool=2.000000 selected_pocket=2.000000
 End of Program
emcTaskPlanExecute(M6 T2) returned 2
emcTaskPlanLevel() returned 1
emcTaskPlanSetWait() called
emcTaskPlanLevel() returned 1
emcTaskPlanLevel() returned 1

So script is getting called but NO movement is done (like  G Codes are not executed), and after that I need to STOP it manually to send another command (like after that is in freezed state) 
Best part is if I call for example o<go_to_home> call it works so a bit confused :(

Can anyone help with this or anyone had similar issue? I really hope someone can help me

Thanks a lot

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

More
16 Oct 2022 22:06 #254273 by andypugh
Replied by andypugh on topic REMAP M6 weird issue
I can understand why you would be confused. I am too.

If you type the G-code commands in the MDI window do the axes move?
I am wondering if feed hold is active or something like that. (Probably not spindle-at-speed as G0 moves don't wait for that)
It would seem logical that if you see the "End of Program" it must have finished executing the G53 G0 moves, but it might only mean that they have been added to the queue and that the interpreter has moved on.

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

More
17 Oct 2022 22:57 #254372 by ddB0515
Replied by ddB0515 on topic REMAP M6 weird issue
OMG

I had typo in tool-change in HAL and that's why didn't work
Fixed that and all works super fine...
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed

Note to myself: check 2x times every time HAL changes
The following user(s) said Thank You: tommylight

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

Time to create page: 0.061 seconds
Powered by Kunena Forum