1
General Mach Discussion / Re: Advanced G Code Programming - Advise or Alternatives Needed
« on: March 02, 2013, 05:05:20 PM »
Thanks for the replies. I like both of these ideas quite a bit. The way I look at it now, I will probably use a little of both of those tricks. In order to get the L parameter to work as I want, I need the subprogram to not execute if I turn it off (ie. if the toggle variable = 0).
Thanks to bobeson and his thread (link below), I was able to setup an equation to set any non-zero value to 1, and 0 always equates to 0.
Link:http://www.machsupport.com/forum/index.php?topic=13329.0
Amazingly that code works!! Now I'm wondering how will a slightly modified version of that equation will work if I tie it in with HimyKabibble's suggestion of using variables for the z depth.... some very interesting stuff could be done with this.
I'll have to play around with it a little more to figure out which will work better for my situation. Maybe there's an even simpler method still, but this gives me something to think about.
Thanks to bobeson and his thread (link below), I was able to setup an equation to set any non-zero value to 1, and 0 always equates to 0.
Link:http://www.machsupport.com/forum/index.php?topic=13329.0
Quote
#1=1 (hole1 toggle)
#2=1 (slot toggle)
(Cut Hole)
#11=#1
#11=[ 1- [ 1 xor #11 ]]
M98 P1 L[ #11 ]
(Cut Slot)
#11=#2
#11=[ 1- [ 1 xor #11 ]]
M98 (slot.nc) L[ #11 ]
M30
O1
g1 x3 F100
x0
M99
Amazingly that code works!! Now I'm wondering how will a slightly modified version of that equation will work if I tie it in with HimyKabibble's suggestion of using variables for the z depth.... some very interesting stuff could be done with this.
I'll have to play around with it a little more to figure out which will work better for my situation. Maybe there's an even simpler method still, but this gives me something to think about.