Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
- gunrak
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
07 Nov 2021 14:10 #225557
by gunrak
Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic was created by gunrak
Hi,
I would like to call tool_touch_off.ngc subroutine from my remapped M6 subroutine, but I am missing parameters:
#<fast_probe_fr> = #1 (set from probe screen fast probe feed rate)
#<slow_probe_fr> = #2 (set from probe screen slow probe feedrate)
#<z_max_travel> = #3 (max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = #4 (max xy distance the tool travels before erroring out if not contact is made)
#<retract_distance> = #6 (distance the tool retracts after making contact during fast feed mode)
#<spindle_zero_height> = #5 (G53 distance from home to spindle nose triggering point on touch plate)
#<tool_diameter_probe_mode> = #8 (activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = #9 (activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = #10 (current tool's diameter used for offseting probe position in x axis)
Where those parameters are stored? Is there any chance I could access them from subroutine and and use them when I call tool_touch_off.ngc?
Best regards,
Guntars
I would like to call tool_touch_off.ngc subroutine from my remapped M6 subroutine, but I am missing parameters:
#<fast_probe_fr> = #1 (set from probe screen fast probe feed rate)
#<slow_probe_fr> = #2 (set from probe screen slow probe feedrate)
#<z_max_travel> = #3 (max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = #4 (max xy distance the tool travels before erroring out if not contact is made)
#<retract_distance> = #6 (distance the tool retracts after making contact during fast feed mode)
#<spindle_zero_height> = #5 (G53 distance from home to spindle nose triggering point on touch plate)
#<tool_diameter_probe_mode> = #8 (activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = #9 (activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = #10 (current tool's diameter used for offseting probe position in x axis)
Where those parameters are stored? Is there any chance I could access them from subroutine and and use them when I call tool_touch_off.ngc?
Best regards,
Guntars
Please Log in or Create an account to join the conversation.
- MoshKopp
- Offline
- Junior Member
Less
More
- Posts: 20
- Thank you received: 2
07 Nov 2021 16:01 - 07 Nov 2021 16:03 #225560
by MoshKopp
Replied by MoshKopp on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
I have done it like this,
[/code]
[code]#<fast_probe_fr> = 50 (1: set from probe screen fast probe feed rate)
#<slow_probe_fr> = 10 (2: set from probe screen slow probe feedrate)
#<z_max_travel> = 28 (3: max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = 0 (4: max xy distance the tool travels before erroring out if not contact is made)
#<spindle_zero_height> = 87.1121 (5: G53 distance from home to spindle nose triggering point on touch plate)
#<retract_distance> = 0.5 (6: distance the tool retracts after making contact during fast feed mode)
#7= 0 (7: n/a)
#<tool_diameter_probe_mode> = 0 (8: activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = 0 (9: activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = 0 (10: current tool's diameter used for offseting probe position in x axis)
o<tool_touch_off> call [#<fast_probe_fr>] [#<slow_probe_fr>] [#<z_max_travel>] [#<xy_max_travel>] [#<spindle_zero_height>] [#<retract_distance>] [#<go_back_to_start_pos>] [#<tool_diameter_probe_mode>] [#<tool_diameter_offset_mode>] [#<tool_diameter>]
Last edit: 07 Nov 2021 16:03 by MoshKopp.
Please Log in or Create an account to join the conversation.
- Lcvette
- Offline
- Moderator
Less
More
- Posts: 1178
- Thank you received: 618
07 Nov 2021 16:59 #225562
by Lcvette
Replied by Lcvette on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
those parameters are set from the offsets page in probe basic.Hi,
I would like to call tool_touch_off.ngc subroutine from my remapped M6 subroutine, but I am missing parameters:
#<fast_probe_fr> = #1 (set from probe screen fast probe feed rate)
#<slow_probe_fr> = #2 (set from probe screen slow probe feedrate)
#<z_max_travel> = #3 (max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = #4 (max xy distance the tool travels before erroring out if not contact is made)
#<retract_distance> = #6 (distance the tool retracts after making contact during fast feed mode)
#<spindle_zero_height> = #5 (G53 distance from home to spindle nose triggering point on touch plate)
#<tool_diameter_probe_mode> = #8 (activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = #9 (activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = #10 (current tool's diameter used for offseting probe position in x axis)
Where those parameters are stored? Is there any chance I could access them from subroutine and and use them when I call tool_touch_off.ngc?
Best regards,
Guntars
Attachments:
Please Log in or Create an account to join the conversation.
- MoshKopp
- Offline
- Junior Member
Less
More
- Posts: 20
- Thank you received: 2
07 Nov 2021 17:44 - 07 Nov 2021 17:59 #225568
by MoshKopp
Replied by MoshKopp on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
Yes, I know, but if you want to use tool_touch_off.ngc outside it didnt work.
o<tool_touch_off> call [#<fast_probe_fr>] [#<slow_probe_fr>] [#<z_max_travel>] [#<xy_max_travel>] [#<spindle_zero_height>] [#<retract_distance>] [#<go_back_to_start_pos>] [#<tool_diameter_probe_mode>] [#<tool_diameter_offset_mode>] [#<tool_diameter>]
runs the tool_touch_off subroutine, and this one will have parameters.
with #1 #2 #4 etc. you will get the error that Parameter missing
with value like I did it works
How can I use the parameters from Offset page? will have more handling instead of using 2 times parameters
o<tool_touch_off> call [#<fast_probe_fr>] [#<slow_probe_fr>] [#<z_max_travel>] [#<xy_max_travel>] [#<spindle_zero_height>] [#<retract_distance>] [#<go_back_to_start_pos>] [#<tool_diameter_probe_mode>] [#<tool_diameter_offset_mode>] [#<tool_diameter>]
runs the tool_touch_off subroutine, and this one will have parameters.
with #1 #2 #4 etc. you will get the error that Parameter missing
with value like I did it works
How can I use the parameters from Offset page? will have more handling instead of using 2 times parameters
Last edit: 07 Nov 2021 17:59 by MoshKopp.
Please Log in or Create an account to join the conversation.
- gunrak
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
08 Nov 2021 12:26 - 08 Nov 2021 12:27 #225673
by gunrak
This is exactly what I implemented few month ago when I initially set up my router. I had run into issue when I updated values in UI and forgot to update them in subroutine and that caused some mess, that is why I am looking for solution where I can avoid to 'hardcode' values in subroutine and I would prefer if I could somehow get them from the place they are stored and then pass them in to call as parameters. Or some other solution if there is any.
Replied by gunrak on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
I have done it like this,
#<fast_probe_fr> = 50 (1: set from probe screen fast probe feed rate) #<slow_probe_fr> = 10 (2: set from probe screen slow probe feedrate) #<z_max_travel> = 28 (3: max z distance the tool travels before erroring out if not contact is made) #<xy_max_travel> = 0 (4: max xy distance the tool travels before erroring out if not contact is made) #<spindle_zero_height> = 87.1121 (5: G53 distance from home to spindle nose triggering point on touch plate) #<retract_distance> = 0.5 (6: distance the tool retracts after making contact during fast feed mode) #7= 0 (7: n/a) #<tool_diameter_probe_mode> = 0 (8: activates the tool diameter probe subroutine section) #<tool_diameter_offset_mode> = 0 (9: activates the tool diameter offset position for probe subroutine section) #<tool_diameter> = 0 (10: current tool's diameter used for offseting probe position in x axis) o<tool_touch_off> call [#<fast_probe_fr>] [#<slow_probe_fr>] [#<z_max_travel>] [#<xy_max_travel>] [#<spindle_zero_height>] [#<retract_distance>] [#<go_back_to_start_pos>] [#<tool_diameter_probe_mode>] [#<tool_diameter_offset_mode>] [#<tool_diameter>]
This is exactly what I implemented few month ago when I initially set up my router. I had run into issue when I updated values in UI and forgot to update them in subroutine and that caused some mess, that is why I am looking for solution where I can avoid to 'hardcode' values in subroutine and I would prefer if I could somehow get them from the place they are stored and then pass them in to call as parameters. Or some other solution if there is any.
Last edit: 08 Nov 2021 12:27 by gunrak.
Please Log in or Create an account to join the conversation.
- gunrak
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
08 Nov 2021 12:41 #225679
by gunrak
That is correct and tool_touch_off.ngc works fine as far as it is called from UI and I guess when it is called from UI parameters are included, but in case if I call tool_touch_off.ngc from subroutine parameters are missing that is the main problem that I have.
Any ideas how I could get parameters from UI that you listed in picture?
Replied by gunrak on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
[/quote]those parameters are set from the offsets page in probe basic.
That is correct and tool_touch_off.ngc works fine as far as it is called from UI and I guess when it is called from UI parameters are included, but in case if I call tool_touch_off.ngc from subroutine parameters are missing that is the main problem that I have.
Any ideas how I could get parameters from UI that you listed in picture?
The following user(s) said Thank You: zmrdko
Please Log in or Create an account to join the conversation.
- zmrdko
- Offline
- Elite Member
Less
More
- Posts: 165
- Thank you received: 41
29 May 2024 08:46 #301737
by zmrdko
Replied by zmrdko on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
Related question: Is it possible to somehow pass parameter values for tool touch off from ini file? The idea is that the values are not lost by copying config, etc.
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
Less
More
- Posts: 3946
- Thank you received: 1705
29 May 2024 11:19 #301743
by Aciera
Replied by Aciera on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
Not sure if this is what you are looking for but by default you should be able to access values from the ini file in gcode using this format
#<_ini[section]name>
#<_ini[section]name>
The following user(s) said Thank You: zmrdko
Please Log in or Create an account to join the conversation.
- zmrdko
- Offline
- Elite Member
Less
More
- Posts: 165
- Thank you received: 41
29 May 2024 11:22 - 29 May 2024 11:24 #301744
by zmrdko
Replied by zmrdko on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
Yes, I am aware of that. But question is more like where to put this expression, so that probe basic gets the value from INI to tool touch off parameters.
Last edit: 29 May 2024 11:24 by zmrdko.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
Less
More
- Posts: 1813
- Thank you received: 733
29 May 2024 15:17 #301751
by spumco
Replied by spumco on topic Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic
If you look at the tool_touch_off subroutine, the tool touch-off position values appear to be stored as persistent variables in the .var file.
Specifically #5181, #5182, & #5183 (X/Y/Z).
I don't have a linux machine in front of me right now, so I can't open the UI and see exactly how the 'set tool touch off position' button works, but I suspect it just writes the values of the three fields to the appropriate variable numbers without any super-complicated backstage stuff. It also (probably) reads those values at UI launch.
I'm not sure what the value is of using the INI file to store the location vs. just using the .vars file... but far be it from me to challenge someone wanting a 'peculiar' feature or change; I'm guilty of fiddling with all sorts of stuff like this.
If you want to store & retrieve the values from your INI file, I think you could do it like this:
Edit INI file:
Edit tool_touch_off.ngc:
I think that should work, but please be careful to test at really low speeds. Note that this 'hack' has nothing to do with the on-screen tool touch-off locations which are managed through the GUI. You can still enter the location on-screen, but you've essentially hijacked the tool setter subroutine so it ignores the on-screen values (which are still stored are variables).
Further, if you update Probe Basic your 'hack' is likely to get overwritten and will need to be re-done. The subroutine will need to be edited again, and if you've made any changes to the UI those will also need to be re-added to the updated version.
Possibly you could create a new 'touch off location' display field and stick it in a new user tab - those shouldn't get over-written if you update PB.
I did something similar for my ATC sequence by using INI values for the Z-movement locations and speeds rather than the values hard-coded in the tool change subroutines.
Specifically #5181, #5182, & #5183 (X/Y/Z).
I don't have a linux machine in front of me right now, so I can't open the UI and see exactly how the 'set tool touch off position' button works, but I suspect it just writes the values of the three fields to the appropriate variable numbers without any super-complicated backstage stuff. It also (probably) reads those values at UI launch.
I'm not sure what the value is of using the INI file to store the location vs. just using the .vars file... but far be it from me to challenge someone wanting a 'peculiar' feature or change; I'm guilty of fiddling with all sorts of stuff like this.
If you want to store & retrieve the values from your INI file, I think you could do it like this:
Edit INI file:
[TOOL_SETTER] (or whatever you want)
TOOL_SETTER_X = 0.000
TOOL_SETTER_Y = 1.234
TOOL_SETTER_Z = 5.678
Edit tool_touch_off.ngc:
...
#<tool_touch_x_coords> = #<ini[TOOL_SETTER]TOOL_SETTER_X
#<tool_touch_y_coords> = #<ini[TOOL_SETTER]TOOL_SETTER_Y
#<tool_touch_z_coords> = #<ini[TOOL_SETTER]TOOL_SETTER_Z
...
I think that should work, but please be careful to test at really low speeds. Note that this 'hack' has nothing to do with the on-screen tool touch-off locations which are managed through the GUI. You can still enter the location on-screen, but you've essentially hijacked the tool setter subroutine so it ignores the on-screen values (which are still stored are variables).
Further, if you update Probe Basic your 'hack' is likely to get overwritten and will need to be re-done. The subroutine will need to be edited again, and if you've made any changes to the UI those will also need to be re-added to the updated version.
Possibly you could create a new 'touch off location' display field and stick it in a new user tab - those shouldn't get over-written if you update PB.
I did something similar for my ATC sequence by using INI values for the Z-movement locations and speeds rather than the values hard-coded in the tool change subroutines.
The following user(s) said Thank You: zmrdko
Please Log in or Create an account to join the conversation.
Moderators: KCJ, Lcvette
Time to create page: 0.125 seconds