Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: GRAYHIL on January 30, 2012, 03:33:51 PM

Title: SWITCH OFF AXIS
Post by: GRAYHIL on January 30, 2012, 03:33:51 PM
Apart from disconnecting an axis motor from the board, is it possible to to switch an axis off via G code to go from 3 axis milling to 2 axis turning?
ie xyz milling to xz turning to avoid unintentional movement in the y unused axis which would be locked/clamped.
Graham
Title: Re: SWITCH OFF AXIS
Post by: Hood on January 30, 2012, 04:08:53 PM
You can disable the axis from VB so you could have a macro in your code to do it
Hood
Title: Re: SWITCH OFF AXIS
Post by: ger21 on January 30, 2012, 04:20:13 PM
Can you just set up two profiles?
Title: Re: SWITCH OFF AXIS
Post by: GRAYHIL on January 31, 2012, 04:54:31 AM
I understand the two profiles reply, but what is VB AND MACRO is it a kind of subcode within the G code?
Graham
Title: Re: SWITCH OFF AXIS
Post by: Hood on January 31, 2012, 02:34:19 PM
DoOemButton(251) is the oem code to toggle the axis inhibit for the Y axis so you could add that to a text file and save as something like m1111.m1s and save it to your profiles macro folder. Any time you call m1111 from MDI or code it will toggle the Y axis inhibit, ie if its inhibited it will turn it back on, if its already on it will inhibit.
You could write two macros and have them looking at the Y axis inhibit LED and that way you could make sure that when you want to inhibit it will and turn back on it will. For example if you saved the following as m1111.m1s it would inhibit the Y even if its already inhibited, ie it wouldnt toggle it back on.

If Not GetOemLED(87) Then
DoOemButton(251)
End If

If you saved the following as m1112.m1s then it would turn the axis back on even if it is already on, ie it wouldnt toggle it to inhibit it.

If  GetOemLED(87) Then
DoOemButton(251)
End If


So you could call m1111 when you want to inhibit and m1112 when you want to enable and you would be safe in the knowledge that you wouldnt inadvertently toggle to the opposite of what you want.

Hood
Title: Re: SWITCH OFF AXIS
Post by: GRAYHIL on January 31, 2012, 02:47:52 PM
Thanks Hood
This is a new to language/code to me. Will experiment tomorrow if all goes well and I do not have to go on a shopping trip >:D
Graham