using variabloes with a Fadal
Close
Login to Your Account
Likes Likes:  0
Results 1 to 20 of 20
  1. #1
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default using variabloes with a Fadal

    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

  2. #2
    Join Date
    Feb 2014
    Location
    Sunny South West Florida, USA
    Posts
    2,881
    Post Thanks / Like
    Likes (Given)
    10701
    Likes (Received)
    3274

    Default

    You're correct in thinking that you can do parametric/variable coding for CNC machining, and much of what you learned about programming computers still applies (IF/THEN, DO/WHILE, VALUE++, etc)...

    However, the specific syntax that your Fadal needs is beyond me, as I've never touched one.

    Don't worry, lots of Fadal gurus around here, someone will straighten you out.

  3. #3
    Join Date
    Jan 2014
    Location
    Chicago
    Posts
    153
    Post Thanks / Like
    Likes (Given)
    45
    Likes (Received)
    53

    Default

    As you found out, you dont have the correct syntax. (It looks like your code is more like what a fanuc control would want)

    Do a google search for 'fadal manual'
    Look in the user manual and read the section on Macro programming. There will be examples and descriptions to help you get it correct.

    It helps to make a small simple program first to make sure it runs and debug if theres an issue, then build on that once its working.

    Sent from my SM-G930P using Tapatalk

  4. #4
    Join Date
    Nov 2013
    Country
    UNITED STATES
    State/Province
    Utah
    Posts
    4,640
    Post Thanks / Like
    Likes (Given)
    1222
    Likes (Received)
    2602

    Default

    This might help, it's a link to a PM Topic.


    https://www.google.com/url?sa=t&sour...mZ80_U8T6g64j7

  5. #5
    Join Date
    Oct 2013
    Location
    New Jersey
    Posts
    1,111
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    946

    Default

    I used to do parametric programming on a Fadal using the macro language all the time. BIG hint, it is based on Microsoft Basic! I did a program that cut a 15 degree tapered pocket 12"x18" and 7" deep with overcut corners in HR steel. First pass roughing with an insert cutter, then finish with solid mill with a radius at 0.010" steps. Tested the program by changing the parameters and cutting a 1"x2" tapered pocket 1/2" deep in aluminum. Whole program was about 50 lines. I'd love to send you an example but it has been 20 years!

    Another hint. Create subroutines and pass the parameters into the subroutine using the variables. My programs were frequently for just a couple parts. I had a variable for Safe Z that I always set at about 6" because I often didn't know how the operator was clamping the part. He could change that variable and it would change everywhere. Or he could search on it and replace it with a fixed value in certain operations. Hope this helps.

    Life is too short to program that way anymore. On my homebuilt machine and the bedmill at work we use CamBam for $149. It sure as hell isn't MasterCam but it saves me a ton of time and makes changing to different tool when I break one so much easier. 40 sessions before you buy, nothing to lose trying it.

  6. #6
    Join Date
    Jan 2015
    Country
    UNITED STATES
    State/Province
    Missouri
    Posts
    1,048
    Post Thanks / Like
    Likes (Given)
    211
    Likes (Received)
    656

    Default

    How about fusion 360 it’s free and probably a lot safer for your machine backplot it out before you crash your money printing machine
    Don


    Sent from my iPhone using Tapatalk Pro

  7. #7
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    Thanks for the response. But what I`m still missing is the syntax that works. For example, if I wanted the Z axis to go to the variable number, something like - G01 Z[#101]. I`m not sure if that`s the correct syntax. Or it was suggested to me that the variable needs to be an R number, like Z[R1} or something like that. And the GOTO line doesn`t work, what`s the proper syntax for "GOTO" ?

  8. #8
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    Yes, Fusion 360 is great, and I`ve used that. I`m trying to do some very simple cutting, thought it would be easier to just type in a couple lines. ....having problem getting the correct syntax for the few lines... Thanks.

  9. #9
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    Missouri
    Posts
    17
    Post Thanks / Like
    Likes (Given)
    1
    Likes (Received)
    1

    Default

    Have you found the info you are looking for? i have a Fadal book with a macro/Parametric programming section, if needed i could provide some info.

  10. #10
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    No I haven`t found the info I`m looking for yet. I`m pretty sure I`m on the right track, just need to know the correct syntax to type it in. I think the "GOTO" command will work, but I`m thinking there`s another word used instead of "GOTO". Also, the variables might have to be a letter & a number, like R1 or something like that. Any help you could give would be greatly appreciated. Thanks.

  11. #11
    Join Date
    Sep 2010
    Location
    Victoria Australia
    Posts
    3,724
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    1469

    Default

    Quote Originally Posted by Tommy Dean View Post
    No I haven`t found the info I`m looking for yet. I`m pretty sure I`m on the right track, just need to know the correct syntax to type it in. I think the "GOTO" command will work, but I`m thinking there`s another word used instead of "GOTO". Also, the variables might have to be a letter & a number, like R1 or something like that. Any help you could give would be greatly appreciated. Thanks.
    Hello Tommy,
    GOTO is used in the Fadal Macro Language. It can be used with either a Line Sequence Number, of a Label; an example of each follows:

    N5
    -----------
    -----------
    -----------
    #GOTO N5 (GOTO a Line Number)



    #:LOOP
    -----------
    -----------
    -----------
    #GOTO :LOOP (GOTO a Line containing a LABEL)

    Following is an example of repeating an X/Y profile to a Full Depth at a specified DOC

    #V1=0.0 (Z Start Level)
    #V2=-2.0 (DOC)
    #V3=-11.0 (Full Depth)

    #:LOOP
    #V1=V1+V2 (Increment DOC)
    #IF V1 < V3 THEN V1 = V3 (Prevent Over Cutting in Z)
    G01 Z V1 F_ _

    (X/Y Profile Starts Here)
    -------------
    -------------
    -------------
    -------------
    (X/Y Profile Ends Here)

    #IF V1 > V3 THEN GOTO :LOOP

    Note, that in the above example, the Full Depth doesn’t have to be evenly divisible by the DOC. Accordingly, the DOC can be changed without consideration of the Full Depth.



    Regards,

    Bill
    Last edited by angelw; 11-23-2019 at 04:36 AM.

  12. #12
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    Quote Originally Posted by angelw View Post
    Hello Tommy,
    GOTO is used in the Fadal Macro Language. It can be used with either a Line Sequence Number, of a Label; an example of each follows:

    N5
    -----------
    -----------
    -----------
    #GOTO N5 (GOTO a Line Number)



    #:LOOP
    -----------
    -----------
    -----------
    #GOTO :LOOP (GOTO a Line containing a LABEL)

    Following is an example of repeating an X/Y profile to a Full Depth at a specified DOC

    #V1=0.0 (Z Start Level)
    #V2=-2.0 (DOC)
    #V3=-11.0 (Full Depth)

    #:LOOP
    #V1=V1+V2 (Increment DOC)
    #IF V1 < V3 THEN V1 = V3 (Prevent Over Cutting in Z)
    G01 Z V1 F_ _

    (X/Y Profile Starts Here)
    -------------
    -------------
    -------------
    -------------
    (X/Y Profile Ends Here)

    #IF V1 > V3 THEN GOTO :LOOP

    Note, that in the above example, the Full Depth doesn’t have to be evenly divisible by the DOC. Accordingly, the DOC can be changed without consideration of the Full Depth.



    Regards,

    Bill
    Bill,
    Thanks for the info. I managed to get the "GOTO" command to work, but not the " G01 Z V1 F_ _ " line. I assumed that the F was feedrate, so I put a number in there, but it still got an error. I also tried a pound sign in front of it, since that`s what fixed the GOTO that wouldn`t work, but no luck yet. I still can`t use a variable with a G01 command to move one of the axis. Any ideas?

  13. #13
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    Missouri
    Posts
    17
    Post Thanks / Like
    Likes (Given)
    1
    Likes (Received)
    1

    Default

    I found this example in the Fadal book, i know it is for drilling, but, i thought what the heck? maybe it will help.img_1498.jpgimg_1500.jpg

  14. #14
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    Yes indeed, looks like this may be what I was looking for. Appears that the pound sign and plus sign are important.... I`ll give it a try again. Thank you very much. .... Tom

  15. #15
    Join Date
    Jan 2014
    Country
    UNITED STATES
    State/Province
    Washington
    Posts
    4,662
    Post Thanks / Like
    Likes (Given)
    845
    Likes (Received)
    2537

    Default

    I had hoped to forget all the BS I learned about Fadals, but here is one thing I think I recall.

    V variables are not allowed in NC lines. You have to move them to R variables.

    Try changing Bill's example to.....

    #IF V1 < V3 THEN V1 = V3 (Prevent Over Cutting in Z)
    #R9 = V1
    #G01 Z+R9 F_ _
    Last edited by Vancbiker; 11-25-2019 at 04:14 PM. Reason: Added missing # and +

  16. #16
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    That explains alot. I will try that. Good thing there are people out there that are smarter than me, I would have never guessed something like that. Thanks, Tom

  17. #17
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    Well that didn`t work either. My program crashes with any use of an R variable. I remember reading something awhile back about some kind of an option when the machine is bought that enables the machine to use macros and variables. I`m beginning to wonder if my machine is even capable of it. I guess I have more research to do. If anybody else has heard of this option, and how to check my machine for it, I`d appreciate that. Thanks for all of your help. ....Tom

  18. #18
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    After doing more reading, I see why a couple people mentioned above to just skip the programing and use Fusion 360. Holy cow it gets complicated real fast....

  19. #19
    Join Date
    Sep 2008
    Country
    UNITED STATES
    State/Province
    California
    Posts
    1,706
    Post Thanks / Like
    Likes (Given)
    1138
    Likes (Received)
    986

    Default

    Quote Originally Posted by Tommy Dean View Post
    After doing more reading, I see why a couple people mentioned above to just skip the programing and use Fusion 360. Holy cow it gets complicated real fast....
    I'm sure you already know this, all the the Fadal manuals are availible for download (free) at Fadalcnc.com

  20. #20
    Join Date
    Nov 2019
    Country
    UNITED STATES
    State/Province
    South Dakota
    Posts
    10
    Post Thanks / Like
    Likes (Given)
    0
    Likes (Received)
    0

    Default

    Quote Originally Posted by triumph406 View Post
    I'm sure you already know this, all the the Fadal manuals are availible for download (free) at Fadalcnc.com
    Yes I see that, that`s where I was reading. I might be trying to type a simple program that isn`t simple at all. Looks like I have more to learn...


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •