![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Parametric Programing (custom macro b, fadal macro, okuma user task) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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. Last edited by gravy; 04-18-2009 at 01:32 PM. |
|
#2
| |||
| |||
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". |
|
#3
| |||
| |||
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Fanuc Serial Number Macro | TomL21 | G-Code Programing | 4 | 05-08-2009 09:36 AM |
| Testing program for Macro (Fanuc Macro B) | NickDP | Fanuc | 2 | 03-27-2009 04:15 PM |
| Seriel Number stamping or engraving | JeffreyCNY | Manual Machining Tooling | 6 | 06-26-2008 05:41 AM |
| Convert Fanuc Macro to Fadal Macro | bfoster59 | Fadal | 1 | 11-09-2007 12:41 AM |
| Engraving Macro | MachineSMM | General CNC (Mill and Lathe) Control Software (NC) | 12 | 03-03-2005 06:32 AM |