M6 remap with tool_touch_off.ngc causing gcode parser to fail

More
2 years 1 week ago #312749 by zmrdko
i am using remapped m6, where I call tool_touch_off.ngc after each tool change
this is causing error:
Code:
[code][qtpyvcp.plugins.gcode_properties][DEBUG] P value out of range with G10 L1 (gcode_properties.py:681) https://github.com/kcjengr/probe_basic/blob/main/configs/probe_basic/subroutines/tool_touch_off.ngc#L93 https://github.com/kcjengr/qtpyvcp/blob/main/src/qtpyvcp/plugins/gcode_properties.py#L677 from the tests I did, the issue is with having parameter #5400 there So something is unable to translate parameter number into actual parameter and hence throwing error code with P value out of range with G10 L1 Question is, if I did something wrong - like placing tool_touch_off.ngc all into M6 remap call or is there a bug with interpreting parameter number in call: [code][code]result, seq = gcode.parse(self.loaded_file, self.canon, unitcode, initcode)
[/code][/code][/code]

Please Log in to join the conversation.

More
2 years 1 week ago #312751 by Aciera

i am using remapped m6
 

Could you post your remap?

[edit]
I presume you are getting this when loading the gcode.

Please Log in to join the conversation.

More
2 years 1 week ago #312760 by zmrdko
here is the remap:
Code:
O<m6remap> sub ;(debug, change: current_tool=#<_current_tool>) ;(debug, change: selected_tool=#<_selected_tool>) ;o100 if [EXISTS[#<_ini[tool_change]xpos>]] ; (debug, [tool_change]xpos exists: #<_ini[tool_change]xpos>) ;o100 else ; (debug, [tool_change]xpos does not exist) ;o100 endif ;o110 if [EXISTS[#<_ini[tool_change]ypos>]] ; (debug, [tool_change]ypos exists: #<_ini[tool_change]ypos>) ;o110 else ; (debug, [tool_change]ypos does not exist) ;o110 endif M73 #<tmp_current_tool> = #<_current_tool> #<tmp_selected_tool> = #<_selected_tool> #<init_x> = #<_x> #<init_y> = #<_y> #<init_z> = #<_z> (only do toolchange if the current tool is different from selected tool) o100 if [#<tmp_current_tool> NE #<tmp_selected_tool>] (go to tool change position defined in ini, via safe Z0) G90 G0 G53 Z#5163 G0 G53 X#<_ini[tool_change]xpos> Y#<_ini[tool_change]ypos> o100 endif M6 (use built in M6 behavior) (tool touchoff after M6 tool change) o110 if [#<tmp_current_tool> NE #<tmp_selected_tool>] o<tool_touch_off> call o110 endif (go to initial XY position via safe Z0 then go initial Z0 position) G90 G0 G53 Z#5163 G0 X#<init_x> Y#<init_y> O<m6remap> endsub [1] m2

github.com/zmrdko/probe_basic/blob/4671e...routines/m6remap.ngc

Please Log in to join the conversation.

More
More
2 years 1 week ago #312764 by Aciera
Have you tried inserting a debug statement in your 'tool_touch_off.ngc' to see what the value of '#5400' actually is when that G10 L1 .. line is called?

For example:

Code:
#<new_tool_length_offset> = [ABS[#<spindle_zero_height> + #5063 - #<offset_z>]] (debug, Current Tool Number : #5400) G10 L1 P #5400 Z [#<new_tool_length_offset>] (5400 = tool number)

[edit]

You may need to add an if case so as not to run parts of your remap if not in task mode (ie block it from being run on load)

something like:
Code:
o100 if [[#<_task> EQ 1] .... o100 end if

Please Log in to join the conversation.

More
2 years 1 week ago #312805 by zmrdko
Thank you, it worked!!

Please Log in to join the conversation.

Time to create page: 0.093 seconds
Powered by Kunena Forum