- Posts: 38
- Thank you received: 0
Tool Diameter in py script
- MatthiasF1210
- Topic Author
- Offline
- Junior Member
-
Less
More
7 years 3 months ago #140833
by MatthiasF1210
Tool Diameter in py script was created by MatthiasF1210
Hi,
I want to use the tool diameter inside an custom gui and a py script, but don't find a corresponding hal pin (or something similar) to retrieve the information.
Any help?
Thanks
Matthias
I want to use the tool diameter inside an custom gui and a py script, but don't find a corresponding hal pin (or something similar) to retrieve the information.
Any help?
Thanks
Matthias
Please Log in to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
-
Less
More
- Posts: 1018
- Thank you received: 0
7 years 3 months ago #140835
by Mike_Eitel
Replied by Mike_Eitel on topic Tool Diameter in py script
Halui presents tool parameters.
Please Log in to join the conversation.
- MatthiasF1210
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 38
- Thank you received: 0
7 years 3 months ago #140836
by MatthiasF1210
Replied by MatthiasF1210 on topic Tool Diameter in py script
Thanks for the replay.
halui just represents offsets not the diameter...
halui just represents offsets not the diameter...
Please Log in to join the conversation.
7 years 3 months ago #140853
by phillc54
Replied by phillc54 on topic Tool Diameter in py script
I think this python code adapted from
linuxcnc.org/docs/html/config/python-int...xcnc_stat_attributes
will do what you want.
Code:
import linuxcnc
s = linuxcnc.stat()
s.poll()
if s.tool_in_spindle != 0: # a tool is loaded
print s.tool_table[s.tool_in_spindle].diameter
Please Log in to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
-
Less
More
- Posts: 1018
- Thank you received: 0
7 years 3 months ago #140867
by Mike_Eitel
Replied by Mike_Eitel on topic Tool Diameter in py script
Halui in MASTER
....
halui.tool.length−offset.z float out
current applied tool length offset for the Z axis
halui.tool.diameter float out
Current tool diameter, or 0 if no tool is loaded.
halui.tool.number u32 out
current selected tool
spindle
.....
....
halui.tool.length−offset.z float out
current applied tool length offset for the Z axis
halui.tool.diameter float out
Current tool diameter, or 0 if no tool is loaded.
halui.tool.number u32 out
current selected tool
spindle
.....
Please Log in to join the conversation.
7 years 3 months ago #140870
by pl7i92
Replied by pl7i92 on topic Tool Diameter in py script
woudent the paramerter be the most recent tooldiameter to greb
ToolDiameter = #5410
the table can be modified by G10
ToolDiameter = #5410
the table can be modified by G10
Please Log in to join the conversation.
7 years 3 months ago #140873
by phillc54
Replied by phillc54 on topic Tool Diameter in py script
I don't think you can read numbered parameters from python.
Please Log in to join the conversation.
7 years 3 months ago #140906
by newbynobi
Replied by newbynobi on topic Tool Diameter in py script
Just curious,
what GUI are you planing? Just because I believe this thread is wrong here in the gmoccapy area. Should I move it to other GUI?
Norbert
what GUI are you planing? Just because I believe this thread is wrong here in the gmoccapy area. Should I move it to other GUI?
Norbert
Please Log in to join the conversation.
- MatthiasF1210
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 38
- Thank you received: 0
7 years 3 months ago #140967
by MatthiasF1210
Replied by MatthiasF1210 on topic Tool Diameter in py script
Hi,
I am doing an small panel inside gmoccapy, where i want to display and calculate some cutting parameters. I found inside the gmoccapy.py file something like this and was wondering if I can use this inside my py-script.
@Mike_Eitel
in my machine the is no parameter like this (just offsets and number).
@phillc54
thanks I will try this....
what GUI are you planing? Just because I believe this thread is wrong here in the gmoccapy area. Should I move it to other GUI?
I am doing an small panel inside gmoccapy, where i want to display and calculate some cutting parameters. I found inside the gmoccapy.py file something like this and was wondering if I can use this inside my py-script.
Code:
def _update_toolinfo( self, tool ):
toolinfo = self.widgets.tooledit1.get_toolinfo( tool )
if toolinfo:
# Doku
# toolinfo[0] = cell toggle
# toolinfo[1] = tool number
# toolinfo[2] = pocket number
# toolinfo[3] = X offset
# toolinfo[4] = Y offset
# toolinfo[5] = Z offset
# toolinfo[6] = A offset
# toolinfo[7] = B offset
# toolinfo[8] = C offset
# toolinfo[9] = U offset
# toolinfo[10] = V offset
# toolinfo[11] = W offset
# toolinfo[12] = tool diameter
# toolinfo[13] = frontangle
# toolinfo[14] = backangle
# toolinfo[15] = tool orientation
# toolinfo[16] = tool info
self.widgets.lbl_tool_no.set_text( str( toolinfo[1] ) )
self.widgets.lbl_tool_dia.set_text( toolinfo[12] )
self.widgets.lbl_tool_name.set_text( toolinfo[16] )
# we do not allow touch off with no tool mounted, so we set the
# coresponding widgets unsensitive and set the description acordingly
if tool <= 0:
self.widgets.lbl_tool_no.set_text( "0" )
self.widgets.lbl_tool_dia.set_text( "0" )
self.widgets.lbl_tool_name.set_text( _( "No tool description available" ) )
self.widgets.btn_tool_touchoff_x.set_sensitive( False )
self.widgets.btn_tool_touchoff_z.set_sensitive( False )
else:
self.widgets.btn_tool_touchoff_x.set_sensitive( True )
self.widgets.btn_tool_touchoff_z.set_sensitive( True )
@Mike_Eitel
halui.tool.diameter float out
Current tool diameter, or 0 if no tool is loaded.
in my machine the is no parameter like this (just offsets and number).
@phillc54
thanks I will try this....
Please Log in to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
-
Less
More
- Posts: 1018
- Thank you received: 0
7 years 3 months ago #140970
by Mike_Eitel
Replied by Mike_Eitel on topic Tool Diameter in py script
I remember now.
The tool diameter is shown in halui but only for short time going, either with T or when M6 is recognized. Then back to 0.
In my comp (calculating some cutting parameters and showing via LCD) I therefore store the value if it is not zero..
Sorry that I didn't remember that...
Mike
The tool diameter is shown in halui but only for short time going, either with T or when M6 is recognized. Then back to 0.
In my comp (calculating some cutting parameters and showing via LCD) I therefore store the value if it is not zero..
Sorry that I didn't remember that...
Mike
Please Log in to join the conversation.
Time to create page: 0.140 seconds
