change tool commend with button

More
25 Jan 2025 13:00 - 25 Jan 2025 13:01 #319815 by rockcnc
change tool commend with button was created by rockcnc
Hi everyone
I need some help with ATC.
I used remap m6 Python and need some button to change the tool (M6 TX).
I can't use MDI for some reason
Do you have any thoughts on this?
Last edit: 25 Jan 2025 13:01 by rockcnc.

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

More
25 Jan 2025 18:05 #319834 by Aciera
Replied by Aciera on topic change tool commend with button
Have a look at mdi_command as in this example (instead of 'net coolant-flood => halui.mdi-command-00' you would connect it to the button hal pin):
forum.linuxcnc.org/qtvcp/54583-call-cust...om-gui-button#315402
The following user(s) said Thank You: Unlogic

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

More
26 Jan 2025 11:28 - 26 Jan 2025 11:31 #319879 by rockcnc
Replied by rockcnc on topic change tool commend with button
Unfortunately, I remapped M6, and in my Python code due to certain reasons, I cannot use mdi mode.
I mean this code you suggest is good for giving mdi code. I need to do it in auto mode.
When I open and run a G code, it works perfectly fine, so I need this button to execute a line of G code in auto mode
Last edit: 26 Jan 2025 11:31 by rockcnc.

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

More
26 Jan 2025 16:32 - 26 Jan 2025 16:41 #319894 by Aciera
Replied by Aciera on topic change tool commend with button
I'm sorry but I don't understand why and when you would need to push a button during a programmed tool change.
Usually a tool change in gcode defines the T word (eg T3 M6) and your python remap would then handle the ATC tool change.

Unfortunately, I remapped M6, and in my Python code due to certain reasons, I cannot use mdi mode.

Not sure what that means but in a remap you can add command to the queue like this:

self.execute( 'your command here')

[edit]
Are you maybe confusing python remaps with the python interface?
linuxcnc.org/docs/html/remap/remap.html
linuxcnc.org/docs/html/config/python-interface.html
Last edit: 26 Jan 2025 16:41 by Aciera.

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

More
27 Jan 2025 05:35 #319929 by rockcnc
Replied by rockcnc on topic change tool commend with button
I have used self-execute command in my Python remap.
now I need to use it in my python interface ui
but it seems to be incorrect

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

More
27 Jan 2025 06:26 #319930 by Aciera
Replied by Aciera on topic change tool commend with button
The python interface cannot use self.execute() that has to be done in the remap.

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

More
29 Jan 2025 09:09 #320061 by rockcnc
Replied by rockcnc on topic change tool commend with button
So my main problem is when I use "tool touch off" or "touch off" button sometimes randomly it starts tool change process and
net tool-change-request control. 0.tool-change => hm2_7i96.0.gpio.022.out
this pin supposed to become output when we are doing tool change
But suddenly out of nowhere its stuck and don't do anything
So I came up with the idea of adding
if (s. task_mode == 2):
At my Tool change remap
this solution fixes my problem but I no longer can use MDI and its mean I only can do tool change when its running a G-code in auto mode.
What do you suggest?
Do you know why this happened or how to solve it? I tried to create a tab and put some button
and execute tool change commands but as you said it's impossible

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

More
29 Jan 2025 09:28 #320063 by Aciera
Replied by Aciera on topic change tool commend with button

So my main problem is when I use "tool touch off" or "touch off" button sometimes randomly it starts tool change process


That sounds pretty crazy, I've never heard of anything like this. What GUI are you using?
I think I would want to find the reason for that before doing anything else.

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

More
29 Jan 2025 11:09 #320070 by rockcnc
Replied by rockcnc on topic change tool commend with button
i'm using axis

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

More
29 Jan 2025 13:06 #320083 by Aciera
Replied by Aciera on topic change tool commend with button
The 'Touch Off' and 'Tool Touch Off' buttons create an MDI call with an G10 L... command through the python interface. I'm afraid I have no idea how that could randomly start a tool change process in your config. 


 
Attachments:

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

Time to create page: 0.076 seconds
Powered by Kunena Forum