Results 1 to 3 of 3

Thread: number engraving macro

  1. #1
    Registered
    Join Date
    Jan 2008
    Location
    usa
    Posts
    62
    Downloads
    0
    Uploads
    0

    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...

    Usage

    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
    Last edited by gravy; 04-18-2009 at 01:32 PM.


  2. #2
    Registered
    Join Date
    Jan 2008
    Location
    usa
    Posts
    62
    Downloads
    0
    Uploads
    0

    ok

    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".



    USAGE

    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.

    EXAMPLE

    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
    Registered
    Join Date
    Jul 2008
    Location
    U.S.A.
    Posts
    4
    Downloads
    0
    Uploads
    0

    making this macro into a serial number macro

    hello,

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

    %
    O1234( SERIAL NUMBER )
    #500=#500+1
    G65P20A#500H58X-Y-Z-
    M30
    %

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


Similar Threads

  1. Fanuc Serial Number Macro
    By TomL21 in forum G-Code Programing
    Replies: 4
    Last Post: 05-08-2009, 09:36 AM
  2. Replies: 2
    Last Post: 03-27-2009, 04:15 PM
  3. Seriel Number stamping or engraving
    By JeffreyCNY in forum Manual Machining Tooling
    Replies: 6
    Last Post: 06-26-2008, 05:41 AM
  4. Convert Fanuc Macro to Fadal Macro
    By bfoster59 in forum Fadal
    Replies: 1
    Last Post: 11-09-2007, 12:41 AM
  5. Engraving Macro
    By MachineSMM in forum General CNC (Mill and Lathe) Control Software (NC)
    Replies: 12
    Last Post: 03-03-2005, 06:32 AM

Posting Permissions


 


About CNCzone.com

    We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

Follow us on

Facebook Dribbble RSS Feed


Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.