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:

Sequential serial numers (again)


Bill Craven
 Share

Recommended Posts

Has anyone heard of (or tried) creating macros in a text editor to create a program that would be DNCd to a control to call up a series of sub programs (stored in the control) that would sequentially increment a serial number?

 

My visualization of this would be: a large program in the DNC computer that would have as many programs as required serial numbers in one file separated by M00 (rather than M30), so that every time the operator loads a new part and presses cycle start a new serial number would be engraved.

 

This method would require no operator intervention other than NOT resetting the program in the DNC computer.

 

(If the control had enough memory you would not have to use a DNC computer)

 

This method would not have to use a macro in the control.

 

It sounds too simple, what am I missing?

Link to comment
Share on other sites
Guest CNC Apps Guy 1

code:

%

O8001(3 DIGIT SERIALIZATION)

G0G90G54X.5Y.75S6500M3 <----POSITION HERE FOR 1ST NUMBER

G43Z.05H01M8

(FIND FIRST DIGIT)

IF[#524EQ0]GOTO 10

IF[#524EQ1.]GOTO 11

IF[#524EQ2.]GOTO 12

IF[#524EQ3.]GOTO 13

IF[#524EQ4.]GOTO 14

IF[#524EQ5.]GOTO 15

IF[#524EQ6.]GOTO 16

IF[#524EQ7.]GOTO 17

IF[#524EQ8.]GOTO 18

IF[#524EQ9.]GOTO 19

#3000=99(SETTING ERROR)

M00

N10M98P4000

GOTO 925

N11M98P4001

GOTO 925

N12M98P4002

GOTO 925

N13M98P4003

GOTO 925

N14M98P4004

GOTO 925

N15M98P4005

GOTO 925

N16M98P4006

GOTO 925

N17M98P4007

GOTO 925

N18M98P4008

GOTO 925

N19M98P4009

GOTO 925

 

(FIND 2ND DIGIT)

N925 G0G90G54X.7 Y.75 <----POSITION HERE FOR 2ND NUMBER

IF[#525EQ0]GOTO 20

IF[#525EQ1.]GOTO 21

IF[#525EQ2.]GOTO 22

IF[#525EQ3.]GOTO 23

IF[#525EQ4.]GOTO 24

IF[#525EQ5.]GOTO 25

IF[#525EQ6.]GOTO 26

IF[#525EQ7.]GOTO 27

IF[#525EQ8.]GOTO 28

IF[#525EQ9.]GOTO 29

#3000=99(SETTING ERROR)

M00

N20M98P4000

GOTO 950

N21M98P4001

GOTO 950

N22M98P4002

GOTO 950

N23M98P4003

GOTO 950

N24M98P4004

GOTO 950

N25M98P4005

GOTO 950

N26M98P4006

GOTO 950

N27M98P4007

GOTO 950

N28M98P4008

GOTO 950

N29M98P4009

GOTO 950

 

(FIND 3RD DIGIT)

N950 G0G90G54X.9 Y.75 <----POSITION HERE FOR 3RD NUMBER

IF[#526EQ0]GOTO 30

IF[#526EQ1.]GOTO 31

IF[#526EQ2.]GOTO 32

IF[#526EQ3.]GOTO 33

IF[#526EQ4.]GOTO 34

IF[#526EQ5.]GOTO 35

IF[#526EQ6.]GOTO 36

IF[#526EQ7.]GOTO 37

IF[#526EQ8.]GOTO 38

IF[#526EQ9.]GOTO 39

#3000=99(SETTING ERROR)

M00

N30M98P4000

GOTO 975

N31M98P4001

GOTO 975

N32M98P4002

GOTO 975

N33M98P4003

GOTO 975

N34M98P4004

GOTO 975

N35M98P4005

GOTO 975

N36M98P4006

GOTO 975

N37M98P4007

GOTO 975

N38M98P4008

GOTO 975

N39M98P4009

 

(UPDATE AND TEST COUNTERS)

N975 #526=#526+1

IF [#526 LT 10.]GOTO 980

#526=0

#525=#525+1

IF [#525 LT 10.]GOTO 980

#525=0

#524=#524+1

IF [#524 LT 10.]GOTO 980

#524=0

 

N980M9

G91G28Z0M19

M30

 

 

O4000 (ZERO)

G91G0X-.0004Y.1076

G90

G1Z-.005F20.

G91

G1X.0176

G2X.0374Y-.0194I-.0021J-.05

X.0164Y-.0417I-.0488J-.0432

G1X-.0009Y-.1012

G2X-.0157Y-.0372I-.0527J.0004

X-.0372Y-.0157I-.0375J.0371

G1X-.0353

G2X-.0372Y.0157I.0004J.0528

X-.0157Y.0372I.0371J.0376

G1Y.1059

G2X.0157Y.0389I.0585J-.001

X.0372Y.0175I.0382J-.033

G1X.0177

G90Z.05

M99

O4001 (ONE)

G91G0X-.0359Y.0719

G90

G1Z-.005F20.

G91

X.0357Y.0361

Y-.2156

X-.0357

X.0718

G90

G0Z.05

M99

O4002 (TWO)

G91G0X-.071Y.0531

G90

G1Z-.005F20.

G91

G2X.0157Y.0375I.0535J-.0004

X.0377Y.0159I.0379J-.0371

G1X.0352

G2X.0375Y-.0159I-.0005J-.0531

X.0159Y-.0375I-.0373J-.038

X-.0164Y-.0383I-.0527J-.0001

G1X-.1256Y-.1213

X.142

G90

G0Z.05

M99

O4003 (THREE)

G91G0X-.0605Y.0917

G90

G1Z-.005F20.

G91

G2X.0362Y.0159I.0366J-.0341

G1X.034

G2X.0357Y-.0159I-.0006J-.0494

X.0151Y-.0379I-.04J-.0379

X-.0151Y-.0379I-.0552

X-.0357Y-.0159I-.0363J.0335

X.0357Y-.0159I-.0006J-.0494

X.0151Y-.0379I-.04J-.0379

X-.0151Y-.0374I-.0546J.0002

X-.0357Y-.0159I-.0363J.0335

G1X-.034

G2X-.0362Y.0154I.0002J.0505

G90

G0Z.05

M99

O4004 (FOUR)

G91G0X.0353Y-.1059

G90

G1Z-.005F20.

G91

Y.2117

X-.1059Y-.1411

X.1412

G90

G0Z.05

M99

O4005 (FIVE)

G91G0X.0714Y.1071

G90

G1Z-.005F20.

G91

X-.1428

Y-.0714

X.0895

G2X.0374Y-.0159I-.0005J-.0531

X.0159Y-.0374I-.0372J-.0379

G1Y-.0358

G2X-.0159Y-.0378I-.0537J.0003

X-.0374Y-.0159I-.0379J.0372

G1X-.0357

G2X-.0379Y.0159I.0002J.0536

X-.0159Y.0374I.0372J.0379

G90

G0Z.05

M99

O4006 (SIX)

G91G0X.0555Y.091

G90

G1Z-.005F20.

G91

G3X-.0379Y.0155I-.0376J-.038

G1X-.0352

G3X-.0377Y-.0159I.0002J-.053

X-.0157Y-.0375I.0378J-.0379

G1Y-.1062

G3X.0157Y-.0377I.0533J.0001

X.0377Y-.0157I.0378J.0376

G1X.0352

G3X.0375Y.0157I-.0004J.0535

X.0159Y.0377I-.0371J.0379

G1Y.0352

G3X-.0159Y.0375I-.0531J-.0005

X-.0375Y.0159I-.038J-.0372

G1X-.0352

G3X-.0377Y-.0159I.0002J-.053

X-.0157Y-.0375I.0378J-.0379

G90

G0Z.05

M99

O4007 (SEVEN)

G91G0X-.0714Y.1071

G90

G1Z-.005F20.

G91

X.1428

X-.1071Y-.2142

G90

G0Z.05

M99

O4008 (EIGHT)

G91G0X0.Y.1061

G90

G1Z-.005F20.

G91

X.0176

G2X.0373Y-.016I-.0004J-.0525

X.0157Y-.0374I-.0378J-.0378

X-.0157Y-.0372I-.0528J.0004

X-.0373Y-.0157I-.0376J.0371

G1X-.0352

G3X-.0373Y-.0164I.0005J-.0519

X-.0157Y-.0383I.0398J-.0386

X.0159Y-.0361I.05J.0004

X.0375Y-.0151I.0377J.0395

G1X.0348

G3X.0373Y.0151I-.0001J.0539

X.0157Y.0361I-.0346J.0365

X-.016Y.0383I-.0551J-.0004

X-.037Y.0164I-.0378J-.0356

G1X-.0352

G2X-.0373Y.0157I.0003J.0528

X-.0157Y.0372I.0371J.0376

X.0157Y.0374I.0535J-.0004

X.0373Y.016I.0377J-.0365

G1X.0176

G90

G0Z.05

M99

O4009 (NINE)

G91G0X-.0555Y-.091

G90

G1Z-.005F20.

G91

G3X.0379Y-.0155I.0376J.038

G1X.0352

G3X.0375Y.0157I-.0004J.0535

X.0159Y.0377I-.0371J.0379

G1Y.1062

G3X-.0159Y.0375I-.0532J-.0005

X-.0375Y.0159I-.038J-.0372

G1X-.0352

G3X-.0377Y-.0159I.0002J-.053

X-.0157Y-.0375I.0378J-.0379

G1Y-.0352

G3X.0157Y-.0377I.0533J.0001

X.0377Y-.0157I.0378J.0376

G1X.0352

G3X.0375Y.0157I-.0004J.0535

X.0159Y.0377I-.0371J.0379

G90

G0Z.05

M99

Link to comment
Share on other sites
  • 1 month later...

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