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.