Adapting ManualToolChangeMacro for use with LCNC Master
- hwylie
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 29
- Thank you received: 1
21 May 2017 18:18 #93445
by hwylie
Adapting ManualToolChangeMacro for use with LCNC Master was created by hwylie
As a novice, I will appreciate guidance on adapting the attached Python script (based on that found - thanks to AP - at wiki.linuxcnc.org/cgi-bin/wiki.pl?ManualToolChangeMacro) for use with LCNC Master.
Prior 'emc' module name has been replaced with 'linuxcnc' (per LCNC Python interface guidance), but LCNC start-up fails with NML file not found. Is it necessary to declare the NML file name (tried 'linuxcnc.nml')?
Commenting out line 10 of the script allows LCNC to start, but manual / mdi control is inhibited.
Aware that this macro is not recommended, it is hoped to provide the basis of interim solution for manual tool change.
Prior 'emc' module name has been replaced with 'linuxcnc' (per LCNC Python interface guidance), but LCNC start-up fails with NML file not found. Is it necessary to declare the NML file name (tried 'linuxcnc.nml')?
Commenting out line 10 of the script allows LCNC to start, but manual / mdi control is inhibited.
Aware that this macro is not recommended, it is hoped to provide the basis of interim solution for manual tool change.
Please Log in or Create an account to join the conversation.
- hwylie
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 29
- Thank you received: 1
22 May 2017 06:41 #93459
by hwylie
Replied by hwylie on topic Adapting ManualToolChangeMacro for use with LCNC Master
Now working (as attached) with two additional replacements of 'emc' with 'linuxcnc' (lines 27 & 28), and revised start-up text window to caution the user.
Tested with Axis and Gmoccapy GUIs, a fix is required for full screen mode (of Gmoccapy). While the prompt to change the tool appears on top, it is hidden behind the Gmoccapy window as soon as jogging/touch-off is initiated, meaning that the required keystroke to continue after tool change is not seen by the tool change script (and is of no consequence in the active Gmoccapy window).
An external button linked via halui is a solution (with appropriate script 'h.newpin("done" ...' and 'except (KeyboardInterrupt OR h.done)' ? ), but is there some readily available on-screen means by which the confirmation can be given that the tool is changed and execution can proceed?
Creation of a custom Gmoccapy is expected to be an option, but perhaps there is a simple way of returning focus to the required tool change confirmation window, specifically in Gmoccapy full-screen mode. Can a keyboard function key be programmed to be seen by the script (line 67), ignored (or passed) by Gmoccapy?
Tested with Axis and Gmoccapy GUIs, a fix is required for full screen mode (of Gmoccapy). While the prompt to change the tool appears on top, it is hidden behind the Gmoccapy window as soon as jogging/touch-off is initiated, meaning that the required keystroke to continue after tool change is not seen by the tool change script (and is of no consequence in the active Gmoccapy window).
An external button linked via halui is a solution (with appropriate script 'h.newpin("done" ...' and 'except (KeyboardInterrupt OR h.done)' ? ), but is there some readily available on-screen means by which the confirmation can be given that the tool is changed and execution can proceed?
Creation of a custom Gmoccapy is expected to be an option, but perhaps there is a simple way of returning focus to the required tool change confirmation window, specifically in Gmoccapy full-screen mode. Can a keyboard function key be programmed to be seen by the script (line 67), ignored (or passed) by Gmoccapy?
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11250
- Thank you received: 3759
22 May 2017 08:20 #93461
by rodw
Replied by rodw on topic Adapting ManualToolChangeMacro for use with LCNC Master
I'm not really an expert with Python, but I am sure you will find that Gmocappy uses a different method to raise an error window as I have debugged it.
Have a look in the Gmocappy.py source file and use the same method. You might need to add some libraries to your tool changer code.
Have a look in the Gmocappy.py source file and use the same method. You might need to add some libraries to your tool changer code.
The following user(s) said Thank You: hwylie
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23323
- Thank you received: 4948
22 May 2017 15:01 #93480
by andypugh
Replied by andypugh on topic Adapting ManualToolChangeMacro for use with LCNC Master
It might be worth looking at the current unmodified hal_manualtoolchange, that has a pin that allows you to press "OK" via a hardware button, which is often more convenient.
The following user(s) said Thank You: hwylie
Please Log in or Create an account to join the conversation.
Time to create page: 0.071 seconds