Tommy Dean
Plastic
- Joined
- Nov 19, 2019
Hello everybody I love reading this page, I`m learning a lot. I`m trying to teach myself how to program a Fadal CNC mill. I`m very familiar with old (now outdated) DOS computer programming, and am trying to use some of those ideas on my mill. A lot of the program lines look very familiar. By looking at other`s programs, I see lot of lines being repeated, which can make a small task turn into a huge program. For example, if you wanted to cut .020" off of something, the repeat the process 5 times to end up with .100" removed, the programs I see will list the command to cut off .020", then a command to lower the Z axis .020" then the command again, and again, so the command to cut off .020" was actually typed in 5 times.
What I`m trying to do, is use variables to repeat the same command several times. A youtube video that I watched says to use a variable for the X, Y, and/or Z, and then a "GOTO" command, such as this:
(in this simple example, I would expect the machine to move 2" back and forth cutting .020" off each time forever until I stop the program)
n100 #101 = 8.00 (random start position for example only)
n200 G01 z[#101] (Z goes to the position 8.0)
n300 X4.0 (x goes to the position 4.0)
n400 #101 = [#101-.020] (change variable)
n500 z[#101] (z drops down .020"}
n600 x 2.0 (x heads back to where it started)
n700 #101 = [#101-.020] (change variable)
n800 z[#101] (z drops again down another .020
n900 GOTO n300 (head back up and do it all over)
I know this program won`t work because it won`t even let me send it to the mill using my computer & a serial cable. Am I even close? Thank you for any input, from a CNC rookie, Tom
What I`m trying to do, is use variables to repeat the same command several times. A youtube video that I watched says to use a variable for the X, Y, and/or Z, and then a "GOTO" command, such as this:
(in this simple example, I would expect the machine to move 2" back and forth cutting .020" off each time forever until I stop the program)
n100 #101 = 8.00 (random start position for example only)
n200 G01 z[#101] (Z goes to the position 8.0)
n300 X4.0 (x goes to the position 4.0)
n400 #101 = [#101-.020] (change variable)
n500 z[#101] (z drops down .020"}
n600 x 2.0 (x heads back to where it started)
n700 #101 = [#101-.020] (change variable)
n800 z[#101] (z drops again down another .020
n900 GOTO n300 (head back up and do it all over)
I know this program won`t work because it won`t even let me send it to the mill using my computer & a serial cable. Am I even close? Thank you for any input, from a CNC rookie, Tom