Engraving on a Fanuc 160is-MB

Started by Jon@NOWHERE, April 24, 2025, 02:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jon@NOWHERE

I have a project I am working on that requires a serial number be engraved on the part.   I am guessing the way to go about this is to program the engraving for every letter and 0-9 and then post them out in incremental mode and have the operator input a value in the macro variables to represent the letter or number at each location, then have the main position the tool then call the sub passing the variable that represents the needed letter or number at that location.   Am I making this too complicated?

kccadcam

Which Machine and what control?
I have lots of serializing and date programs.
KC

A Million seconds is 12 Days
A Billion seconds is 31 Years
A Trillion seconds is 31,688 Years

kccadcam

Duh, control is in the Title, sorry waking up....

Here is one version, I believe this was on a Matsuura with Fanuc control:
%
O9118(8 DIGIT SERIALZATION MACRO)
(FOR CALLING OF NUMBERS)
(G65 P9118 H.25 Z-.015 D5. S1.)
(FOR SETTING OF NUMBERS)
(G65 P9118 A12345678.)
(SETS #545 IS THE NUMBER)
IF[#1NE#0]GOTO300
#109=#9
#100=#11
#101=ABS[#26]
#102=ABS[#7]
#112=#102
#103=1000.(BLOCK NUMBER TO CALL)
#19=ABS[#19]
#543=#545
IF[#102EQ#0]THEN#102=8.
#134=#4003
#135=#5003
N20(DIGIT COUNTER)
#112=#102-1
#113=10
WHILE[#112NE0]DO1
#113=#113*10
#112=#112-1
END1
#113=#113-1
IF[#545GT#113]GOTO[200+#102]

N30(EIGHTH DIGIT)
IF[#102LE7.]GOTO40
#1=8.
#145=40
GOTO1010
N31
GOTO[#103+#534]

N40(SEVENTH DIGIT)
IF[#102LE6.]GOTO50
#1=7.
#145=50
GOTO1010
N41
GOTO[#103+#534]

N50(SIXTH DIGIT)
IF[#102LE5.]GOTO60
#1=6.
#145=60
GOTO1010
N51
GOTO[#103+#534]

N60(FIFTH DIGIT)
IF[#102LE4.]GOTO70
#1=5.
#145=70
GOTO1010
N61
GOTO[#103+#534]

N70(FOURTH DIGIT)
IF[#102LE3.]GOTO80
#1=4.
#145=80
GOTO1010
N71
GOTO[#103+#534]

N80(THIRD DIGIT)
IF[#102LE2.]GOTO90
#1=3.
#145=90
GOTO1010
N81
GOTO[#103+#534]

N90(SECOND DIGIT)
IF[#102LE1.]GOTO100
#1=2.
#145=100
GOTO1010
N91
GOTO[#103+#534]

N100(FIRST DIGIT)
#1=1.
#145=110
GOTO1010
N101
#145=120
GOTO[#103+#534]

N120
IF[#19GE1]GOTO210
#545=#545+1
GOTO210
N201#3000=1(NUMBER GREATER THAN 9)
N202#3000=1(NUMBER GREATER THAN 99)
N203#3000=1(NUMBER GREATER THAN 999)
N204#3000=1(NUMBER GREATER THAN 9999)
N205#3000=1(NUMBER GREATER THAN 99999)
N206#3000=1(NUMBER GREATER THAN 999999)
N207#3000=1(NUMBER GREATER THAN 9999999)
N208#3000=1(NUMBER GREATER THAN 99999999)


N1000(NUMBER-0)
G91G0X[#100/4]
G90G1Z-#101F#109
G91G3X[#100/4]Y[#100/4]J[#100/4]
G1Y[#100/2]
G3X-[#100/2]I-[#100/4]
G1Y-[#100/2]
G3X[#100/4]Y-[#100/4]I[#100/4]
G90G0Z#135
G91X[#100/4]
G0X[#100/3]
GOTO#145

N1001(NUMBER-1)
G90G1Z-#101F#109
G91G1X[#100/2]
X-[#100/4]
Y#100
X-[#100/10]Y-[#100/5]
G90G0Z#135
G91X[#100/10]Y[#100/5]
X[#100/4]Y-#100
X[#100/3]
GOTO#145

N1002(NUMBER-2)
G91G0Y[#100-[#100/4]]
G90G1Z-#101F#109
G91G2X[#100/2]I[#100/4]
#110=[[#100/4]*SIN[45]]
#111=[[#100/4]*COS[45]]
G2X-[[#100/4]-#111]Y-[[#100/4]-#110]R[#100/4]
G1X-#111Y-#110
G3X-[#100/4]Y-[#100/2]R#100
G1X[#100/2]
G90G0Z#135
G91X[#100/3]
GOTO#145


N1003(NUMBER-3)
G91G0Y[#100-[#100/4]]
G90G1Z-#101F#109
G91G2X[#100/4]Y-[#100/4]I[#100/4]
G2X-[#100/4]Y-[#100/4]J-[#100/4]
G90G0Z#135
G91G0X[#100/2]Y-[#100/4]
X[#100/3]
GOTO#145

N1004(NUMBER-4)
G91G0Y#100
G90G1Z-#101F#109
G91Y-[#100/2]
X[#100/2]
X-[#100/10]
Y[#100/2]
Y-#100
G90G0Z#135
G91G0X[#100/10]
X[#100/3]
GOTO#145

N1005(NUMBER-5)
G91G0Y[#100/4]
G90G1Z-#101F#109
G91G3X[#100/4]Y[#100/4]I[#100/4]
G1X-[#100/4]
Y[#100/2]
X[#100/2]
G90G0Z#135
G91G0Y-#100
G91X[#100/3]
GOTO#145

N1006(NUMBER-6)
G91G0Y[#100/4]
G90G1Z-#101F#109
G91G2I[#100/4]
G1Y[#100/2]
G2X[#100/2]I[#100/4]
G90G0Z#135
G91G0Y-[#100-[#100/4]]
X[#100/3]
GOTO#145

N1007(NUMBER-7)
G91G0Y#100
G90G1Z-#101F#109
G91G1X[#100/2]
G3X-[#100/2]Y-#100R[#100*2]
G90G0Z#135
G91G0X[#100/2]
G91X[#100/3]
GOTO#145

N1008(NUMBER-8)
G91G0X[#100/4]Y[#100/2]
G90G1Z-#101F#109
G91G2J-[#100/4]
G3J[#100/4]
G90G0Z#135
G91G0X[#100/4]Y-[#100/2]
G91X[#100/3]
GOTO#145

N1009(NUMBER-9)
G91G0Y[#100/4]
G90G1Z-#101F#109
G91G3X[#100/2]I[#100/4]
G1Y[#100/2]
G3I-[#100/4]
G90G0Z#135
G91G0Y-[#100-[#100/4]]
G91X[#100/3]
GOTO#145

N1010(CALCULATE DIGIT MACRO)
#1=ADP[#1]
#106=#1-1
#105=10.
IF[#106EQ0]THEN#105=1.
IF[#106EQ0]GOTO105
WHILE[[#106-1]GT0]DO1
#106=#106-1
#105=#105*10
END1
N105
#106=#0
#544=#543/#105
#534=FIX[#534]
#2=#2-1
#542=#544*#105
#543=#543-#542
IF[#534NE0]GOTO301
#544=#0
N301
GOTO[#145-9]

N210G#134
M99
N300(SET NUMBERS)
#545=#1
M99
Like Like x 5 View List
KC

A Million seconds is 12 Days
A Billion seconds is 31 Years
A Trillion seconds is 31,688 Years

Jon@NOWHERE

#3
The machine is an OKK 5 axis vertical mill.  I can give the exact model when I get back to my notes if you need it.

CNCAppsJames

#4
Quote from: Jon@NOWHERE on April 25, 2025, 08:43 AMThe machine is an OKK 5 axis vertical mill.  I can give the exact model when I get back to my notes if you need it.
@kccadcam MACRO should work on that machine. There should not be anything builder specific in it.
"That bill for your 80's experience...yeah, it's coming due. Soon." Author Unknown

Inventor Pro 2026 - CAD
CAMplete TruePath 2026 - CAV and Post Processing
Fusion360 and Mastercam 2026 - CAM

Jon@NOWHERE

Quote from: kccadcam on April 25, 2025, 06:04 AMDuh, control is in the Title, sorry waking up....

Here is one version, I believe this was on a Matsuura with Fanuc control


Thank you for the help!

Jeff

Do you do a lot of serial numbers?
We have repeat jobs that need serials and we ended up buying an offline engraver to automate the process.
It saves so much time.
The one we have is the Benchmark 320, had it for about 7-8 years now and it's done probably well over 10,000 parts easily.
https://telesis.com/benchmark/

Jon@NOWHERE

Not sure why they decided they want to engrave them in the machine.  The problem is their serial number is alphanumeric, and I am not sure how they come up with it other than pulling numbers out of their butt.  Cause two different part numbers have the same serial number.

CNCAppsJames

I have one that does letters...
"That bill for your 80's experience...yeah, it's coming due. Soon." Author Unknown

Inventor Pro 2026 - CAD
CAMplete TruePath 2026 - CAV and Post Processing
Fusion360 and Mastercam 2026 - CAM

Jon@NOWHERE

Quote from: CNCAppsJames on May 02, 2025, 10:54 PMI have one that does letters...

I would be interested in seeing that one as well if you don't mind sharing.

CNCAppsJames

#10
Here you go.

You cannot view this attachment.
Like Like x 1 View List
"That bill for your 80's experience...yeah, it's coming due. Soon." Author Unknown

Inventor Pro 2026 - CAD
CAMplete TruePath 2026 - CAV and Post Processing
Fusion360 and Mastercam 2026 - CAM

CNCAppsJames

#11
Part 2

You cannot view this attachment.
Like Like x 1 View List
"That bill for your 80's experience...yeah, it's coming due. Soon." Author Unknown

Inventor Pro 2026 - CAD
CAMplete TruePath 2026 - CAV and Post Processing
Fusion360 and Mastercam 2026 - CAM

Jon@NOWHERE

Like Like x 1 View List