The Parameters
- JackRay
- Offline
- Elite Member
-
Less
More
- Posts: 226
- Thank you received: 14
06 Sep 2025 07:49 #334536
by JackRay
The Parameters was created by JackRay
Hello, I am writing G-code files with parameters O<measure> call [#1] [#2] ... and I cannot access certain variables in LinuxCNC 2.9.4 (e.g., <#_tool_diameter>). I need to read this data in my tool table in order to develop my program. Can anyone help me?Thank you.
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4511
- Thank you received: 2013
06 Sep 2025 11:15 #334545
by Aciera
Replied by Aciera on topic The Parameters
Not a lot to go on. Where are you assigning a value to what parameter, where are you trying to access it and what happens when you do?
Usually best to give a short example of what you are trying to do and describe what is not working as expected.
Usually best to give a short example of what you are trying to do and describe what is not working as expected.
Please Log in or Create an account to join the conversation.
- JackRay
- Offline
- Elite Member
-
Less
More
- Posts: 226
- Thank you received: 14
14 Sep 2025 15:00 #334978
by JackRay
Replied by JackRay on topic The Parameters
I am currently developing a parametric program (sub) to measure the exact dimensions of my tools. I need to read the theoretical diameter contained in the tool table that I use for my approaches. Thank you.
Please Log in or Create an account to join the conversation.
- JackRay
- Offline
- Elite Member
-
Less
More
- Posts: 226
- Thank you received: 14
22 Sep 2025 16:44 #335290
by JackRay
Replied by JackRay on topic The Parameters
Hello,
I need to acces at these set :DEBUG, Outil actif = #<tool>)
(DEBUG, Longueur outil = #<tool_length_offset>)
(DEBUG, Diamètre outil = #<tool_diameter>)
(DEBUG, Rayon outil = #<tool_radius>)
wihtout succes
Thanks
I need to acces at these set :DEBUG, Outil actif = #<tool>)
(DEBUG, Longueur outil = #<tool_length_offset>)
(DEBUG, Diamètre outil = #<tool_diameter>)
(DEBUG, Rayon outil = #<tool_radius>)
wihtout succes
Thanks
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
-
Less
More
- Posts: 455
- Thank you received: 192
22 Sep 2025 17:11 #335294
by MaHa
Replied by MaHa on topic The Parameters
This is for the loaded tool.
dont know how to read the tooltable with gcode. I'm affraid it's not possible.
(DEBUG, Outil actif = #5400)
(DEBUG, Longueur outil = #5403)
(DEBUG, Diamètre outil = #5410)
#<tool_radius> = [#5410 / 2]
(DEBUG, Rayon outil = #<tool_radius> )
dont know how to read the tooltable with gcode. I'm affraid it's not possible.
(DEBUG, Outil actif = #5400)
(DEBUG, Longueur outil = #5403)
(DEBUG, Diamètre outil = #5410)
#<tool_radius> = [#5410 / 2]
(DEBUG, Rayon outil = #<tool_radius> )
The following user(s) said Thank You: JackRay
Please Log in or Create an account to join the conversation.
- JT
-
- Away
- Administrator
-
Less
More
- Posts: 1017
- Thank you received: 524
22 Sep 2025 19:24 #335303
by JT
Replied by JT on topic The Parameters
You can use the loaded tool numbered or named parameters in G Code.
5400 - Tool Number. Volatile.
5401-5409 - Tool Offsets for X, Y, Z, A, B, C, U, V & W. Set by G43. Volatile.
5410 - Tool Diameter. Volatile.
5411 - Tool Front Angle. Volatile.
5412 - Tool Back Angle. Volatile.
5413 - Tool Orientation. Volatile.
#<_tool_offset> - Return 1 if tool offset (G43) is on, else 0.
#<_current_tool> - Return number of the current tool in spindle. Same as #5400.
#<_current_pocket> - Return the tool data index for the current tool.
#<_selected_tool> - Return number of the selected tool post a T code. Default -1.
#<_selected_pocket> - Return the tool data index of the selected pocket post a T code. Default -1 (no pocket selected).
You can use O Codes to do calculations.
linuxcnc.org/docs/stable/html/gcode/o-code.html
This might be a lot easier to do in Flex GUI where you can do calculations in Python.
JT
5400 - Tool Number. Volatile.
5401-5409 - Tool Offsets for X, Y, Z, A, B, C, U, V & W. Set by G43. Volatile.
5410 - Tool Diameter. Volatile.
5411 - Tool Front Angle. Volatile.
5412 - Tool Back Angle. Volatile.
5413 - Tool Orientation. Volatile.
#<_tool_offset> - Return 1 if tool offset (G43) is on, else 0.
#<_current_tool> - Return number of the current tool in spindle. Same as #5400.
#<_current_pocket> - Return the tool data index for the current tool.
#<_selected_tool> - Return number of the selected tool post a T code. Default -1.
#<_selected_pocket> - Return the tool data index of the selected pocket post a T code. Default -1 (no pocket selected).
You can use O Codes to do calculations.
linuxcnc.org/docs/stable/html/gcode/o-code.html
This might be a lot easier to do in Flex GUI where you can do calculations in Python.
JT
The following user(s) said Thank You: JackRay
Please Log in or Create an account to join the conversation.
Time to create page: 0.087 seconds