585,573 active members*
3,498 visitors online*
Register for free
Login
Results 1 to 14 of 14
  1. #1
    Join Date
    May 2009
    Posts
    9

    How/Where to save macros

    Hi all,

    I'm teaching myself to write G Code on a Fanuc controller and am getting a pretty good handle on it (thanks in large part to the forums at CNCzone). I want to incorporate macros so I can use variables and logic statements but I can't figure out or locate information on one important item: where and how do you save a macro in order to call it later in another program? LOts of info in manuals and forums on how to write macros... no info on what to do with them once they're written.

    Hope you'll take my elementary question with grace and good humour.
    Thanks for your help.

  2. #2
    Join Date
    Mar 2005
    Posts
    988
    If these are macros you always want on the machine, then just give it a program number and save it on the control just like any other program. Then when you use it, you can call it up by G65, G66, G66.1 (if you're passing values through) or you can use an M98 sub call (if you're not passing values through).
    It's just a part..... cutter still goes round and round....

  3. #3
    Join Date
    Dec 2003
    Posts
    24220
    What controller do you have? You can save and hide them if making them 9000 macro's.
    These can be write protected by parameter so that they do not inadvertently get erased.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  4. #4
    Join Date
    May 2009
    Posts
    9
    Our manual says Fanuc Series Oi-MB... as for entering programs, we use Microvellum and ACAD. I'm learning code to get around the limitations of using those programs. I can write macros in a .txt file, but then where do I save them into the controller in order to call them later? I can also program G-code through the Fanuc CNC screen display function but can't seem to save them.

    Thanks for your help and patience...

  5. #5
    Join Date
    Mar 2003
    Posts
    2932
    A macro is just another program. You save them all in the same place. If you give them program numbers from O8000 to O9999 they can be "locked" to prevent editing and/or erasing them inadvertantly.

    Your DIR might look like this:

    O1000 (MAIN PROGRAM)
    O1001 (SUB #1)
    O1002 (SUB #2)
    O8101 (BOLT-HOLE CIRCLE MACRO)
    O8102 (GRID MACRO)
    O9101 (TOOL CHANGE MACRO)

  6. #6
    Join Date
    May 2009
    Posts
    9

    Ah so!

    A macro is just another program. You save them all in the same place. If you give them program numbers from O8000 to O9999 they can be "locked" to prevent editing and/or erasing them inadvertantly.

    Ah ha! I thought it might work something like that. I will try to find that directory and write something small today. I'll let you all know how it goes.

  7. #7
    Join Date
    Mar 2003
    Posts
    2932
    "that directory" is just your control's program memory. Whenever you EDIT a program, it's in that directory.

  8. #8
    Join Date
    May 2009
    Posts
    9

    still looking for that directory...

    Well, while I get the idea, I can't find the directory that contains programs within the controller. Generally I load files from the company server through the CNC Screen display. If I edit or write programs, I do it through Notepad (text editor). Even programs that I use regularly like surfacing are called from the server.

    So in order to call a macro, it needs to be in the controller's memory, right? I've gotta figure out how to load programs straight to the controller's memory, though my manual is offering no real useful help and all I know how to do is run programs from the server

  9. #9
    Join Date
    Mar 2003
    Posts
    2932
    If you press OFFSET/SETTING, then [SETING], what is your I/O CHANNEL set to?

  10. #10
    Join Date
    Feb 2006
    Posts
    338
    CNC3P0, Either there is a real communication glitch here, or your missing an important chunk of information we are taking for granted. (like ONLY ever used DNC modes...)

    Put the control in EDIT or MEMORY mode. Then press the PROG soft key, the the DIR soft key. That should be a pretty standard way to view the list of programs stored on your control.

  11. #11
    Join Date
    Jun 2008
    Posts
    1511
    If you are loading programs from a company directory to the control then you are loading them into memory. Do the macro the EXACT same way as you would a normal program. Say you write a macro and it's program O5000. Once you load it to the control you can use it as a macro/subprogram. All you have to do is in your main program call it up either by a M98 subprogram call or a G65P5000 macro call.

    Now if you want to load them as a protected programs as Al stated which I always do, you make them a 8000-8999 or 9000-9999 program numbers. You will have to make sure the protection bit is not activated in order to load these program numbers. Once they are loaded then you lock them out. On this series control the parameters for locking them are:
    #3202.0 for the 8000-8999
    #3202.4 for the 9000-9999

    Stevo

  12. #12
    Join Date
    May 2009
    Posts
    9

    almost there

    Morning all,

    @ dcoupar: My I/O channel is set to 4.

    @ dpuch: Yes, I have only used DNC mode. I am attempting to learn to program this machine myself without the aid of formal training, manuals, etc. It's all by way of forums, e-books, and trial and error.

    Now, I've located the directory of programs by entering MEM mode and pressing PROG and then DIR... but how do I add a program to this directory? I understand now that a macro is just a program in this directory, called with an M98 or G65, but how do I store this program in the controller permanently?

    @Stevo1: When I run programs from the company directory, I'm loading them into the controller, but as soon as I load a new program, the old one is gone. Will this change if I name my program "O8000.anc" instead of "16mmMaple.anc"? Does it know to keep the one named "O8000.anc" and discard the one named "16mmMaple.anc"?

    THanks for all the help...

  13. #13
    Join Date
    Mar 2003
    Posts
    2932
    If your I/O device is set to 4 you should be communicating with a Compact Flash card in a PCMCIA adapter. Is this correct? Do you have a memory card inserted to the left of the CRT?

  14. #14
    Join Date
    May 2009
    Posts
    9
    I don't see a Compact Flash card, but that doesn't mean there's not one there somewhere.

Similar Threads

  1. X3 CNC macros
    By trainfred in forum Syil Products
    Replies: 6
    Last Post: 05-21-2008, 01:42 AM
  2. help with macros
    By gj83 in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 2
    Last Post: 04-12-2008, 02:42 AM
  3. macros
    By bob@apc in forum Mazak, Mitsubishi, Mazatrol
    Replies: 2
    Last Post: 02-04-2008, 06:42 PM
  4. Help with macros
    By afterburn25 in forum Haas Mills
    Replies: 4
    Last Post: 04-09-2007, 02:19 PM
  5. macros
    By toyoda in forum Uncategorised CAM Discussion
    Replies: 0
    Last Post: 05-30-2004, 10:56 AM

Tags for this Thread

Posting Permissions

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