589,422 active members*
5,561 visitors online*
Register for free
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008

    number engraving macro

    Here is a part number engraving macro, Fanuc Macro B. It does up to a six digit number. I have used it at work a lot so it has been tested extensively on a Mori-Seiki SV-50. I edited the tool change to make it more generic, the Mori has tool look-ahead.

    I have added scaling and the ability to do decimals in a different macro, but not tested the thing a lot. I separated the decimal out at first, then looped back and multiplied it by 100,000, wrote a decimal point and started over.

    I then ran into problems with floating point math to where even this logic did not work. I got it to work by playing with the amount of decimal places checked to, but it was trial and error and I had no way to quantify it. Thus my pre-occupation with floating point math.

    I'm now having a "duh" moment and realizing that if I just round the darn thing before feeding it back through the loop it may work fine. Someday I'll do that.

    Anywayz, this one works quite well, here...


    G65 P20 A H X Y Z

    A - Number To Be Engraved (Required, Up To 6 Digits)
    H - Offset Used (Required)
    X - Amount To Offset Number In X (If Not Used It Will Engrave At X Zero)
    Y - Amount To Offset Number In Y (If Not Used It Will Engrave At Y Zero)
    Z - Amount To Offset Number In Z (If Not Used It Will Engrave At Z Zero)

    The Macro Uses G59. It Takes The Numbers In The X, Y, And Z Variables,
    Adds Them To The Offset Specified And Puts That In G59.

    It Uses G52, If It Is Stopped In The Middle Go To MDI And Enter "G52 X0".

    ************************************************** ***

    If anyone wants this commented better or whatever, let me know.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2008


    I've added the scaling and decimals to this.

    I've used it for a while but not done any official documentation yet. I'll start that here...

    There is a variable at the beginning of the macro itself (#110) to scale the numbers. A one in this variable will give numbers about .312" tall, A two,
    .625" tall, etc..

    I use a carbide 90 degree deburr/chamfer tool to engrave the numbers, goes .01" deep.

    Macro uses the G59 offsets and changes them in order to offset the number's zero point from the chosen offset's zero point. This was so you could call the macro from a part program and engrave a part number anywhere on the part.

    Macro will engrave up to a six digit number, followed by up to a six digit decimal. (Most controls won't accept a number with 12 digits.)

    Macro uses G52 to shift X. If you cancel the macro while running go to MDI and enter "G52 X0".


    G65 P20 A H X Y Z

    A - Number To Engrave (Required)
    H - Offset To Use (Required)
    X - Amount To Offset X
    Y - Amount To Offset Y
    Z - Amount To Offset Z

    If X, Y, or Z is not used the number will engrave at the chosen offset's zero.


    G65 P20 A45.876 H55. X1. Y2. Z3.

    Will engrave 45.876 at G55 X - 1." Y - 2." Z - 3.".

    Any question or comments appreciated. I was thinking of limiting it to 3 place decimals and calling the scale factor from the macro call. Another easy addition would be to throw in a multiplier and make the scaling more 1 to 1".
    Attached Files Attached Files

  3. #3
    Join Date
    Jul 2008

    making this macro into a serial number macro


    I wrote this as a main program to call your macro:

    O1234( SERIAL NUMBER )

    I just set start location in G58 and we have a serial numbering macro

  4. #4
    Join Date
    Feb 2022

    Re: number engraving macro

    What is the text size as I want .125 height for macro adjustment?

Similar Threads

  1. Fanuc Serial Number Macro
    By TomL21 in forum Parametric Programing
    Replies: 17
    Last Post: 05-11-2024, 05:54 PM
  2. serial number macro
    By Delw in forum Haas Mills
    Replies: 13
    Last Post: 04-25-2012, 12:01 AM
  3. Need to asign a M number to this auto tool zero macro.
    By glengeniii in forum Mach Wizards, Macros, & Addons
    Replies: 4
    Last Post: 12-31-2011, 11:26 PM
  4. number engraving
    By dry run in forum FeatureCAM CAD/CAM
    Replies: 1
    Last Post: 05-10-2011, 01:22 PM
  5. Seq. serial number engraving
    By MSGMachine in forum G-Code Programing
    Replies: 2
    Last Post: 10-29-2010, 02:10 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