Quantcast
Channel: Practical Machinist - Largest Manufacturing Technology Forum on the Web - CNC Machining
Viewing all articles
Browse latest Browse all 20168

Macro Program serial number help

$
0
0
Hi Everyone,
I need to engrave a double digit serial number on parts that I need to make. They need to start at 1-99 and not 01-99 The problem that I cannot figure out is how to do the first 1-9 numbers before moving on to 10. I have written a simple macro but it would not work as I do not know how to get it to recognise the first nine numbers only and then more on to the next double letter ones. Maybe an extra variable that I need to use somewhere?? My numbers will all be in the 8000's programs in the control.
Thanks in advance.

T2 M6
G00 G54 X0.0 Y0.0 S8000 M3
IF[#500EQ1.0]GOTO 1
IF[#500EQ2.0]GOTO 2
IF[#500EQ3.0]GOTO 3
IF[#500EQ4.0]GOTO 4
IF[#500EQ5.0]GOTO 5
IF[#500EQ6.0]GOTO 6
IF[#500EQ7.0]GOTO 7
IF[#500EQ8.0]GOTO 8
IF[#500EQ9.0]GOTO 9
N1M98P8001
GOTO 100
N2M98P8002
GOTO 100
N3M98P8003
GOTO 900
N4M98P8004
GOTO 900
N5M98P8005
GOTO 900
N6M98P8006
GOTO 900
N7M98P8007
GOTO 900
N8M98P8008
GOTO 900
N9M98P8009
(THIS IS WHERE I NEED HELP)
N900 G00 G54 X20.0 Y20.0 (GOES TO SECOND NUMBER POSITION)
IF[#501EQ0]GOTO 20
IF[#501EQ1.]GOTO 21
IF[#501EQ2.]GOTO 22
IF[#501EQ3.]GOTO 23
IF[#501EQ4.]GOTO 24
IF[#501EQ5.]GOTO 25
IF[#501EQ6.]GOTO 26
IF[#501EQ7.]GOTO 27
IF[#501EQ8.]GOTO 28
IF[#501EQ9.]GOTO 29
N20M98P8000
GOTO 901
N21M98P8001
GOTO 901
N22M98P8002
GOTO 901
N23M98P8003
GOTO 901
N24M98P8004
GOTO 901
N25M98P8005
GOTO 901
N26M98P8006
GOTO 901
N27M98P8007
GOTO 901
N28M98P8008
GOTO 901
N29M98P8009
GOTO 901

N901 #501=#501+1
IF [#501 LT 10.0] GOTO 902
#501=0
#500=#500+1
IF [#500 LT 10.0]GOTO 902
#500=0
N902 (END PROGRAM)

M30

Viewing all articles
Browse latest Browse all 20168

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>