584,829 active members*
5,121 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2016
    Posts
    2

    Fanuc Macro programming

    Hi!

    What is the easiest way to program variable macros to subprogram in Fanuc18i?

    I want to do subprogram what fill e.g variable macro #520 to number 100.

    So can/how i do subprogram what i run and then macro is filled?

    Also how i can program PMC DGN bit?

    I want to program DGN number e.g X0050 bit 2 to 0 or 1.

    Can i do M or G code of that?

    Thank you!

  2. #2
    Join Date
    Feb 2006
    Posts
    338

    Re: Fanuc Macro programming

    Not quite sure what you want but this example should show you enough to figure it out on your own.
    To call it from another program use:
    M98 P8000

    Code:
    %
    O8000
    #1=0 (initalize counter)
    N10
    IF[#1GT100] GOTO 20 (Stop if counter is over 100)
    #[520+#1]=33 (#520 to #620 will be set to 33 as #1 increments on each loop)
    #1=#1+1 (increment #1)
    GOTO 10 (next loop cycle)
    N20
    M99
    %
    I have never messed with the Macro bit stuff

  3. #3
    Join Date
    Apr 2016
    Posts
    3

    Re: Fanuc Macro programming

    Hi.

    You can make a G65 call, where you can send variables.
    It works with local variables which goes from 1 to 33.
    I will show you this on next example.

    - simple macro subprogram O00003.nc loaded in MEM of machine, which will call tool and load it's Z offset:

    %
    O00003;
    G00 G17 G21 G40 G49 G90;
    T#1 M06;
    S2500 F500 M3;
    G0 G43 H#1 Z100;
    M99;
    %

    How to use it?
    in any program in your machine MEM you can do calls like this:
    G65 P3. A1.
    where:
    - P = subprogram number
    - A = #1 in your subprogram

    You have all variable adresses in your manual probably. I'm talking about HAAS, but it's uses FANUC language.
    I hope this helped.

  4. #4

    Re: Fanuc Macro programming

    You can NOT write to inputs (X0050 bit2) as they are always being read into the PMC and updated. However, if you can modify your ladder we can mimic the same results. Fanuc allows the part program and the PMC to talk to each other via Macro Variable. When you program #1100=1 it will turn on F54.0 in the ladder. You then will have to edit the ladder to OR F54.0 with the X0050.2 input so either one will set your conditions. If you program #1100=0 the F54.0 will turn off. Also if you turn on G54.0 in the ladder the program can read that as well by #1000. You can write IF #1000=1 then go do something. Or IF #1000=0 go do something.

  5. #5
    Join Date
    Feb 2006
    Posts
    1792

    Re: Fanuc Macro programming

    X is physical input to the PMC. It can be made 0 or 1 by physical means. You need to identify the corresponding point on the terminal strip.
    drdos has some good suggestions.

Similar Threads

  1. Fanuc macro programming, interactive
    By Lazy_Programmer in forum Machinery Manuals / Brochures
    Replies: 5
    Last Post: 04-30-2018, 02:45 PM
  2. Fanuc 3tf & Macro Programming
    By bergen13 in forum Fanuc
    Replies: 3
    Last Post: 02-15-2013, 05:02 PM
  3. Macro Programming on Fanuc Oi Mate TB
    By deetech in forum Fanuc
    Replies: 1
    Last Post: 07-30-2012, 02:14 PM
  4. Fanuc Macro and G-Code Programming
    By kilogulf59 in forum Fanuc
    Replies: 3
    Last Post: 11-01-2006, 06:02 PM

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
  •