587,419 active members*
3,329 visitors online*
Register for free
Login
Results 1 to 17 of 17
  1. #1
    Join Date
    Jul 2009
    Posts
    35

    variable program

    I recently was asked to create a variable program for are old fadal vmc4020.
    It has an 88hs fadal control and is using format2.
    In the program the operator has to set a couple variable such as the size of the stock and finish size needed.
    The stock is a plate that is mounted to an indexer and the tools move to fixed position and mill the plate diameter to the disired diameter as the plate rotates.
    The plates are very large and otherwise wouldnt be able to be machined on the this machine.
    I haven't dealt with this machine in atleast 10 years and have written a number of variable programs for this machine back then with no problems.
    The problem I have now is I am getting an illegal address alarm when the operator starts up the program.

    Any help would be appreciated on what could be the problem with the syntext or format that could be causing the program to fail. Im sure its a simple issue that I just am not seeing.




    %
    O1000(vAR 0D MAIN)
    (T8 7DEG TAPER)
    (T9 750 RGH ENDMILL)
    (T7 DOVETAIL CHMF TOOL)
    ()
    L100(VARIABLE ROUTINE)
    (THESE ARE THE VARIABLES YOU WILL CHANGE)
    (FOR DIF SIZE dia plates)
    (INSERT VALUES FOR V1,V2 IN **DIA VALUES**)
    #V1=0(ENTER **DIA** OF COVER BLANK)
    #V2=0(ENTER FIN **DIA** OF COVER)
    ()
    ()
    ()
    (VARIABLE CONSTANTS)
    (ONCE THESE VALUES ARE SET CORRECTLY)
    (DO NOT CHANGE THEM WHEN RUNNING DIF DIA COVERS)
    #V2=V2/2
    #V3=.375(RAD OF .75 EM)
    #V4=.375(PROGRAM RAD OF 7DG EM)
    #V5=.375(PROGRAM RAD OF CHAMF TOOL)
    #V6=.500(ST PT CLEARANCE OFF PART 7DG TOOL)
    #V7=.500(ST PT CLEARANCE OFF PART CHMF TOOL)
    #V8=.0553(7DG TOOL ADJ AT .45 DPTH INCR)
    ()
    ()
    (***PROGRAM CALCULATIONS DO NOT CHANGE****)
    ()
    (RGH OD CALCS)
    #R1=V2+V3 (X OD FIN SIZE PLUNGE ST POINT)
    ()
    (7DG CALCS)
    #R2=V2+V4+V6(START PT 7DG TOOL W/ V6 CLEAR)
    #R3=V3+V4 (1ST FIN X FEED TO PT 7DG TOOL )
    #R4=V3+V4-V8 (2ND FIN X)
    #R5=V3+V4-V8-V8 (3RD FIN X)
    ()
    (CHMF CALCS)
    #R6=V2+V5+V7(START PT CHMF TOOL W/ V7 CLEAR)
    #R7=V2+V5 (FIN X FEED TO PT CHMF TOOL )
    ()
    ()
    M17
    M30
    (MAIN)
    G0G17G40G49G69G80G90
    L101 (READ VARIABLES)
    T9M6 (ROUGH OD CYCLE)
    S1125M3
    E1G0X+R1Y0
    Z1.0H9
    G1Z.5F25.
    Z-1.25F10.
    M66(START INDEXER ROTATION)
    G0Z1.0
    G80M5M9
    G0Z10.0
    M01
    (7DG ANGLE)
    T8M6
    S875M3
    G0X+R2Y0 (RAP TO X CLEAR PT)
    Z1.0H8
    Z-.45
    G1X+R3F2.0 (FEED TO PT)
    M66(START INDEXER ROTATION)
    G0X+R2 (RAP OUT PT)
    Z-.9
    G1X+R4F2.0 (FEED TO PT)
    M66(START INDEXER ROTATION)
    G0X+R2 (RAP OUT PT)
    Z-1.35
    G1X+R5F2.0 (FEED TO PT)
    M66(START INDEXER ROTATION)
    G0X+R2 (RAP OUT PT)
    G0Z1.0
    G80M5M9
    G0Z10.0
    M01
    (BOTTOM CHAMFER)
    T7M6
    S1000M3
    G0X+R6Y0 (RAP TO CLEAR PT)
    G0Z1.0H7
    Z-1.14 (DEPTH ADJ IF NEEDED)
    G1X+R7F8.0 (FEED IN TO PT)
    M66(START INDEXER ROTATION)
    G0X+R6 (RAPID OUT PT)
    G0Z1.0
    G80M5M9
    G0Z10.0
    X0.0Y0.0
    M6T9
    M0
    G53Y9.90
    M30
    %





    thanks
    Caddisfly

  2. #2
    Join Date
    Nov 2007
    Posts
    78
    I dont know much about sub routines variable calls, but it is calling L101 instead of L100 looks like to me..

    L101 (READ VARIABLES)

  3. #3
    Join Date
    Apr 2006
    Posts
    3206
    I haven't done macros in Format 2, so this is new to me....but I don't see a clear register command at the beginning, and the parenthesis within the macro line could be the problem? In Format 1 a comment should follow an apostrophe.....

    A comment should be (example):
    N16#V11=SQR((V8*V8)-(V10*V10)) ‘Y CENTER OF BLEND

    It'd help if you could post a program that works for you.

  4. #4
    Join Date
    Apr 2008
    Posts
    1577
    I'll try to confirm that with the manual when I get in to work but I agree, the control is expecting a math operation of some kind if you use ( ) with #

    I stared at that a long time without spotting that. Good eye.

  5. #5
    Join Date
    Jul 2009
    Posts
    35
    Quote Originally Posted by FastFieros View Post
    I dont know much about sub routines variable calls, but it is calling L101 instead of L100 looks like to me..

    L101 (READ VARIABLES)

    FF

    L101 calls sub L100 1 time. L102 would execute it 2 times.

    caddisfly

  6. #6
    Join Date
    Jul 2009
    Posts
    35
    Quote Originally Posted by SBC Cycle View Post
    I'll try to confirm that with the manual when I get in to work but I agree, the control is expecting a math operation of some kind if you use ( ) with #

    I stared at that a long time without spotting that. Good eye.
    SBC Cycle, fizzissist,

    That could be. I am looking at some old programs that worked years back and I'm not finding any comments using () on lines with #.

    I will have to make the changes and give it a try.

    Thanks
    caddisfly

  7. #7
    Join Date
    Apr 2008
    Posts
    1577
    Quote Originally Posted by fizzissist View Post
    I haven't done macros in Format 2, so this is new to me....but I don't see a clear register command at the beginning, and the parenthesis within the macro line could be the problem? In Format 1 a comment should follow an apostrophe.....

    A comment should be (example):
    N16#V11=SQR((V8*V8)-(V10*V10)) ‘Y CENTER OF BLEND

    It'd help if you could post a program that works for you.
    You are on the money.

    18.2.5 COMMENTS Comments are very important part of Macro programming. They explain the program to
    others, and remind the programmer why they wrote it the way they did. Comments on a
    macro line begin with an apostrophe ( ‘ ), and can extend to a total line length of 63
    characters.
    N3 # V100=1.2345 ‘V100 IS THE LENGTH OF THE PART 2
    I didn't know about the apostrophe thing. That's good to know, thank you.

  8. #8
    Join Date
    Feb 2008
    Posts
    547

    Let us know what you come up with. This is a great post! I didn't see anything wrong first time through either. I haven't done any variables since I bought my CADCAM. A good refresher problem!!:cheers:
    Steve

  9. #9
    Join Date
    Apr 2006
    Posts
    3206
    Mastercam doesn't do O-ring grooves the way I like 'em, and Fadal doesn't have a canned cycle for them...so I wrote a macro that does 'em the way I like..(well, almost..I'll refine it as I have time)

    Comments are the only thing that save my butt. Even as often as I use my own program, I still need to be reminded of what something does...and if I want to edit later it's invaluable.

  10. #10
    Join Date
    Jul 2009
    Posts
    35
    After reading the posts ,I started digging around for the programming manual and found the same comment rule ( ' ) on the macro lines.
    Makes sense that ( ) would not work on a macro line.

    I'm confident enough it will work now. I'll find out later today.


    Thanks again,
    caddisfly

  11. #11
    Join Date
    Mar 2003
    Posts
    900

    Unhappy

    Caddisfly--
    OOOPPPPS, fat finger syndrome!

  12. #12
    Join Date
    Mar 2003
    Posts
    900

    Talking

    Caddisfly--
    The main issue I see with out running the program is that the comments must be separated by an apostrophe and not an open paren. The Parens are mathmatical operators in the Quick Basic computer language.
    Remove the open and close paren and in put the apostrophes where needed and then try running the program to find any further possible bugs. Let me know if I can help.

    Neal

  13. #13
    Join Date
    Jul 2009
    Posts
    35
    The changes worked.

    Thanks again
    caddisfly

  14. #14
    Join Date
    Apr 2008
    Posts
    1577
    Quote Originally Posted by Neal View Post
    Caddisfly--
    The main issue I see with out running the program is that the comments must be separated by an apostrophe and not an open paren. The Parens are mathmatical operators in the Quick Basic computer language.
    Remove the open and close paren and in put the apostrophes where needed and then try running the program to find any further possible bugs. Let me know if I can help.

    Neal
    Neal,

    Is that what the macro engine is based on (QBasic)? I knew some of the conventions looked familiar but didn't make the link.

  15. #15
    Join Date
    Mar 2003
    Posts
    900
    SBC Cycle--
    The Fadal macros are a sub-set of Q Basic. There are some QB commands that we do not need or use. The macro section in the user's manual gives you the available commands.

    Neal

  16. #16
    Join Date
    Aug 2006
    Posts
    52
    I notice that the program ends with M30, I think you need to end a program that has subroutines with an M2, so it can reset to just beyond the M30 that separates the subroutines from the main program.

  17. #17
    Join Date
    Mar 2003
    Posts
    900
    FYI-- M2 and M30 can be used interchangeably. True that the M30 is used at the end of the sub routine list but it has dual functions depending on the context in which it is used.

    Neal

Similar Threads

  1. Variable changes
    By TNorbut in forum Controller & Computer Solutions
    Replies: 0
    Last Post: 07-23-2008, 01:16 PM
  2. EMC2 variable pitch / variable diameter threading.
    By samco in forum MetalWork Discussion
    Replies: 0
    Last Post: 03-09-2008, 07:40 PM
  3. vARIABLE #3006
    By marrieche in forum G-Code Programing
    Replies: 4
    Last Post: 03-31-2007, 02:31 PM
  4. IF variable = bla THEN do this ELSE do that ?
    By iMisspell in forum G-Code Programing
    Replies: 21
    Last Post: 07-31-2006, 04:57 AM
  5. Replies: 11
    Last Post: 10-09-2005, 05:45 AM

Posting Permissions

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