Tool Change Issues custom QTDragon.

More
12 May 2022 19:32 #242811 by LearningLinuxCNC
In my custom QTDragon UI I am running into an issue with tool changes.

I have manual tool changes working when I do a M6 T? in the MDI box. This works fine the tool change dialog pops up and prompts for the tool change to be completed. On pressing OK the tool change is completed and additional commands can be made.

Now I have a button that runs some python code in the UI. This code does not work. It stalls out and does not show the tool change dialog. Since I can't press the ok button it times out.
        if toolfound:
            try:
                #this is the code to actually drill the holes using Gcode.
                ACTION.SET_MDI_MODE()
                cmdstr = "M6 T" + str(toolnum)
                #ACTION.CALL_MDI(cmdstr)
                print ("MDI command sent " +cmdstr)
                ACTION.CALL_MDI_WAIT(cmdstr, 30.0) # wait until the tool change operation is complete.
                print ("MDI command completed")
                cmdstr = "G43"
                #self.c.mdi(cmdstr)
                print ("MDI command sent " +cmdstr)
                ACTION.CALL_MDI_WAIT(cmdstr) #wait for the tool length offset to be applied.
                print ("MDI command completed")

This is the output in the terminal.
('Tool description: ', '0.054 SprayballDrill ')
('Hole index:', 4)
('Hole diameter:', 0.054, 0.054)
('Tool Selected For Drilling is tool: ', 2054)
MDI command sent M6 T2054
[QtDesigner.QTVCP.QT_ACTION][DEBUG]  MDI_WAIT_COMMAND= M6 T2054, maxt = 30.0 (qt_action.py:128)
[QtDesigner.QTVCP.QT_ACTION][DEBUG]  MDI_COMMAND: M6 T2054 (qt_action.py:131)
[QtDesigner.QTVCP.QT_ACTION][DEBUG]  MDI_COMMAND_WAIT timeout past 30.0 sec. Error: -1 (qt_action.py:135)
MDI command completed
MDI command sent G43
[QtDesigner.QTVCP.QT_ACTION][DEBUG]  MDI_WAIT_COMMAND= G43, maxt = 5 (qt_action.py:128)
[QtDesigner.QTVCP.QT_ACTION][DEBUG]  MDI_COMMAND: G43 (qt_action.py:131)
MDI command completed

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

More
12 May 2022 19:33 #242812 by LearningLinuxCNC
My question is why is the tool change dialog not showing up when calling the tool change from MDI_WAIT_COMMAND?

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

More
13 May 2022 02:35 #242846 by cmorley
MDI_WAIT_COMMAND blocks the GUI code until it finishes.
The GUI code must run to pop the tool change dialog.

You could:
-use an external tool dialog
-use MDI_CALL_LiST (currently no docs for)
-use an external program to call the MDI commands (Qtvcp probing does this)
-

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

More
13 May 2022 14:03 #242878 by LearningLinuxCNC
Thanks for the info. I will try the subprogram route like basic_probe uses. Looks to be the best for my overall application.

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

Moderators: cmorley
Time to create page: 0.065 seconds
Powered by Kunena Forum