Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Recommended Posts

Hello. I am going to explain this the best I can. 

I manufacture firearms components. Bolts, carriers, gas tubes, gas valves, gas blocks, receivers, hand guards etc. I am looking for a way to identify our parts from others as well as label when they were manufactured. I do not have time to engrave the company name, and date of manufacture though. So I need to develop a system to easily identify both pieces of information. 

I was thinking about putting a dot with a drill X distance from zero to indicate the month of manufacture. 

The X dimension would change along with the month. 

Something like:

X= MONTH# 1 (JAN) =.1

2 (FEB) = .15

3 (MAR) = .2

ETC...

G81 X#### Z-0.01 R0.1 F10

 

Would it be something like IF P???? (MONTH PARAMETER) = 1 THEN #### = .1 ?

 

I don't mess with macros much, which is why I'm here. Hopefully this is possible. 

 

Thank you in advance. 

Link to comment
Share on other sites

We do some S/N engraving along with our logo and part info here. I set mine up to be simple for the operator to input a few numbers and press start. Anyways, you would set a macro variable and then subcall another program with a G65P_____. You could do it all in the same program, of course, but I like having a simple program so that nothing important gets deleted when the operator makes a typo. Here is a quick sample of the structure I use for the number part of my programs. In your case I would just engrave the number of the month or a letter corresponding with the month for easy identification at a later time.


:8503(NUMBERS) 
(08-03-18) 
 
IF[#105EQ1]GOTO1(1)
IF[#105EQ2]GOTO2(2)
IF[#105EQ3]GOTO3(3)
IF[#105EQ4]GOTO4(4)
IF[#105EQ5]GOTO5(5)
IF[#105EQ6]GOTO6(6)
IF[#105EQ7]GOTO7(7)
IF[#105EQ8]GOTO8(8)
IF[#105EQ9]GOTO9(9)
IF[#105EQ0]GOTO10(0) 
 
GOTO9999 
 
N1 
( ENGRAVE 1 )
G0G91X-.0286Y.0714 
Z-1.8
G1Z-.21F#131 
X.0286Y.0286F#132
Y-.2 
X-.0286
G0Z.26 
X.0286 
Z-.05
G1Z-.21F#131 
X.0286F#132
G0Z2.01
GOTO9999 
 
N2 
( ENGRAVE 2 )
G0G91X-.0555Y.0714 
Z-1.8
G1Z-.21F#131 
G2X.0495Y.0286R.0571F#132
G1X.0044 
G2X.0571Y-.0546R.0571
X-.0148Y-.0358R.0572 
X-.0513Y-.0384R.4745 
G3X-.0492Y-.0712R.0965 
G1X.1196 
G0Z2.01
GOTO9999 
 
N3 
( ENGRAVE 3 )
G0G91X-.0575Y.0712 
Z-1.8
G1Z-.21F#131 
G2X.0498Y.0286R.0576F#132
G1X.0073 
G2X.0416Y-.0156R.0631
X.0156Y-.0344R.0457
X-.0425Y-.0498R.0505 
G1X-.0143
G0Z.26 
X.0143 
Z-.05
G1Z-.21F#131 
G2X.0453Y-.0502R.0505F#132 
X-.0156Y-.0344R.0457 
X-.0415Y-.0156R.0631 
G1X-.0131
G2X-.0498Y.0286R.0577
G0Z2.01
GOTO9999 
 
N4 
( ENGRAVE 4 )
G0G91X.0371Y-.1
Z-1.8
G1Z-.21F#131 
Y.2F#132 
X-.1035Y-.1529 
X.1328 
G0Z2.01
GOTO9999 
 
N5 
( ENGRAVE 5 )
G0G91X.0583Y.1001
Z-1.8
G1Z-.21F#131 
X-.1209F#132 
Y-.0886
G2X.0537Y.0172R.0923 
G1X.0034 
G2X.0338Y-.008R.0757 
X.0234Y-.0206R.0606
X.011Y-.0362R.0653 
X-.0087Y-.0324R.0653 
X-.0545Y-.0316R.0628 
G1X-.009 
G2X-.0419Y.0157R.0636
X-.0112Y.0129R.0636
G0Z2.01
GOTO9999 
 
N6 
( ENGRAVE 6 )
G0G91X.0576Y.0699
Z-1.8
G1Z-.21F#131 
G3X-.0518Y.0303R.0594F#132 
X-.0566Y-.0411R.0594 
X-.0115Y-.063R.1781
X.0075Y-.0512R.1781
X.0577Y-.0451R.0594
X.0566Y.0411R.0594 
X.0028Y.0181R.0594 
X-.0594Y.0594R.0594
X-.0594Y-.0594R.0594 
X.0017Y-.0141R.0594
G0Z2.01
GOTO9999 
 
N7 
( ENGRAVE 7 )
G0G91X-.06Y.1
Z-1.8
G1Z-.21F#131 
X.12F#132
G3X-.06Y-.2R.3634
G0Z2.01
GOTO9999 
 
N8 
( ENGRAVE 8 )
G0G91X-.0064Y.0071 
Z-1.8
G1Z-.21F#131 
X.0128F#132
G3X.0465Y.0465R.0465 
X-.0465Y.0464R.0465
G1X-.0128
G3X-.0215Y-.0053R.0464 
X-.0249Y-.0411R.0464 
X.0464Y-.0465R.0464
X-.0535Y-.0535R.0535 
X.0094Y-.0305R.0535
X.0441Y-.0231R.0536
G1X.0128 
G3X.0536Y.0536R.0536 
X-.0536Y.0535R.0536
G0Z2.01
GOTO9999 
 
N9 
( ENGRAVE 9 )
G0G91X-.0576Y-.0699
Z-1.8
G1Z-.21F#131 
G3X.0518Y-.0303R.0594F#132 
X.0566Y.0411R.0594 
X.0115Y.063R.1781
X-.0075Y.0512R.1781
X-.0577Y.0451R.0594
X-.0566Y-.0411R.0594 
X-.0028Y-.0181R.0594 
X.0594Y-.0594R.0594
X.0594Y.0594R.0594 
X-.0017Y.0141R.0594
G0Z2.01
GOTO9999 
 
N10
( ENGRAVE 0 )
G0G91X-.0467Y.0674 
Z-1.8
G1Z-.21F#131 
G3X-.0119Y-.0674R.1972F#132
X.0119Y-.0674R.1972
X.0467Y-.033R.0496 
X.0467Y.033R.0496
X.0119Y.0674R.1972 
X-.0119Y.0674R.1972
X-.0467Y.033R.0496 
X-.0467Y-.033R.0496
G0Z2.01
GOTO9999 
 
N9999
M99
%

If you are interested in learning Custom Macro stuff, I highly recommend this book by Peter Smid. It's an easy read and will really open your eyes up to all the possibilities of Custom Macros. I am far from an expert on the subject, but know enough to get by. 

https://www.amazon.com/Fanuc-Custom-Macros-Peter-Smid/dp/0831131578/ref=sr_1_8?dchild=1&keywords=custom+macro&qid=1627384092&sr=8-8

Another book: https://www.amazon.com/Programming-using-Fanuc-Custom-Macro/dp/0071713328/ref=sr_1_3?dchild=1&keywords=custom+macro&qid=1627384127&sr=8-3

  • Like 1
Link to comment
Share on other sites

Thank you for finding this so quickly. I have done date engraving in the past but only on haas machines. Unfortunately I am doing this project on a handful of Fanuc machines.

The dot = month is the system I was instructed to use. 

I am looking through that exact book right now looking for the answer as well. 

Link to comment
Share on other sites

This is just a rough sketch

You can call it at whatever point you want

G65P8888A1.

You can set A to your correct month

 

%
O8888

IF[#1LT1]GOTO9000
IF[#1GT12]GOTO9000

IF[#1EQ1]GOTO1001
IF[#1EQ2]GOTO1002
IF[#1EQ3]GOTO1003
IF[#1EQ4]GOTO1004
IF[#1EQ5]GOTO1005
IF[#1EQ6]GOTO1006
IF[#1EQ7]GOTO1007
IF[#1EQ8]GOTO1008
IF[#1EQ9]GOTO1009
IF[#1EQ10]GOTO1010
IF[#1EQ22]GOTO1011
IF[#1EQ12]GOTO1012


N1001
G81X.1Z-.01R.01F10.
G80
M99

N1002
G81X.15Z-.01R.01F10.
G80
M99

N1003
G81X.2Z-.01R.01F10.
G80
M99

N1004
G81X.25Z-.01R.01F10.
G80
M99

N1005
G81X.3Z-.01R.01F10.
M99
G80

N1006
G81X.35Z-.01R.01F10.
G80
M99

N1007
G81X.4Z-.01R.01F10.
G80
M99

N1008
G81X.45Z-.01R.01F10.
G80
M99

N1009
G81X.50Z-.01R.01F10.
G80
M99

N1010
G81X.55Z-.01R.01F10.
G80
M99

N1011
G81X.60Z-.01R.01F10.
G80
M99

N1012
G81X.65Z-.01R.01F10.
G80
M99

N9000
M99
%

 

  • Thanks 1
  • Like 1
Link to comment
Share on other sites

When I probe with fanfuk I always record date and time 1st..see below.. u can use dif par thou

POPEN
DPRNT[*----------------*]
DPRNT[**PROBING*OP160*] 
#1=FIX[#3011/10000]
#2=#3011-[#1*10000]
#3=FIX[#2/100] 
#4=#2-[#3*100] 
DPRNT[**DATE*#4[20]**#3[20]*#1[40]]
#1=FIX[#3012/10000]
#2=#3012-[#1*10000]
#3=FIX[#2/100] 
#4=#2-[#3*100] 
DPRNT[**TIME*#1[20]**#3[20]**#4[20]] 
DPRNT[*----------------*]

 

Result is 

 ---------------- 
 PROBING OP170 
  DATE  26    7  2021
  TIME   9   58   14 
 ----------------  

 

  • Like 1
Link to comment
Share on other sites

There is probably a more elegant way to do this, but my approach would be something like this:

#121=#3011 (capture date)
#101=FIX[#121/100]
#102=FIX[#121/10000]
#103=#101-[#102*100]
	

so for today's date, as Fanuc writes it (202107270) that little bit would make #103 equal to 7

From there it would be something like this:

IF[#103EQ1.]GOTO1
IF[#103EQ2.]GOTO2
IF[#103EQ3.]GOTO3
IF[#103EQ4.]GOTO4
IF[#103EQ5.]GOTO5
IF[#103EQ6.]GOTO6
IF[#103EQ7.]GOTO7
IF[#103EQ8.]GOTO8
IF[#103EQ9.]GOTO9
IF[#103EQ10.]GOTO10
IF[#103EQ11.]GOTO11
IF[#103EQ12.]GOTO12
	

 

  • Thanks 1
  • Like 1
Link to comment
Share on other sites

#121=#3011
=20210729

#101=FIX[#121/100]
=202107

#102=FIX[#121/10000]
=2021

#103=#101-[#102*100]
=7

I find myself using the macrocalc from NCplot quite often. I know I could of simplified this by doing something like "#101=FIX[#3011/100]" but by writing it to #121 it allows me to check my math with the calculator.

http://ncplot.com/freetools.htm

 

 

Link to comment
Share on other sites

So, combining the logic from MIL-TFP-41 & Johns program would get this:

%
O8888

#121=#3011 (capture date)
#101=FIX[#121/100]
#102=FIX[#121/10000]
#103=#101-[#102*100]

IF[#103LT1]GOTO9000
IF[#103GT12]GOTO9000

IF[#103EQ1.]GOTO1001
IF[#103EQ2.]GOTO1002
IF[#103EQ3.]GOTO1003
IF[#103EQ4.]GOTO1004
IF[#103EQ5.]GOTO1005
IF[#103EQ6.]GOTO1006
IF[#103EQ7.]GOTO1007
IF[#103EQ8.]GOTO1008
IF[#103EQ9.]GOTO1009
IF[#103EQ10.]GOTO1010
IF[#103EQ11.]GOTO1011
IF[#103EQ12.]GOTO1012

N1001
G81X.1Z-.01R.01F10.
G80
M99

N1002
G81X.15Z-.01R.01F10.
G80
M99

N1003
G81X.2Z-.01R.01F10.
G80
M99

N1004
G81X.25Z-.01R.01F10.
G80
M99

N1005
G81X.3Z-.01R.01F10.
M99
G80

N1006
G81X.35Z-.01R.01F10.
G80
M99

N1007
G81X.4Z-.01R.01F10.
G80
M99

N1008
G81X.45Z-.01R.01F10.
G80
M99

N1009
G81X.50Z-.01R.01F10.
G80
M99

N1010
G81X.55Z-.01R.01F10.
G80
M99

N1011
G81X.60Z-.01R.01F10.
G80
M99

N1012
G81X.65Z-.01R.01F10.
G80
M99

N9000
M99

 

  • Thanks 1
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...