PDA

View Full Version : Repeating toolpath



kubotaman
02-22-2013, 07:20 PM
Seems like in the last week or so it was asked how a person can repeat a toolpath due to wanting multiple pieces of the same kind. For the life of me I can't find the thread. Anyone point me to it. I want to edit the file but without re-starting the file to recut. I tried the search but not having any luck. Sorry!

donek
02-22-2013, 07:29 PM
There are many approaches. One of the simplest is to call the part file from within another part file. Below is a sample of how we cut multiples of an inlay graphic on a snowboard base.

MS,4,.5
JS,6,1
INPUT "HOW MANY MULTIPLES OF 4 DO YOU WANT TO CUT? " &TNUM

&N=1

CUTCYCLE:
J2,12.5+9.3*(&N-1),3-.6561
FP,TEXT.SBP,1.00, 1.00, 1.00, 1,2
J2,12.5+9.3*(&N-1),5.666-.6561
FP,TEXT.SBP,1.00, 1.00, 1.00, 1,2
J2,12.5+9.3*(&N-1),8.333-.6561
FP,TEXT.SBP,1.00, 1.00, 1.00, 1,2
J2,12.5+9.3*(&N-1),11-.6561
FP,TEXT.SBP,1.00, 1.00, 1.00, 1,2


&N=&N+1
IF &N>&TNUM THEN GOTO FINISH
IF &N>6 THEN GOTO FINISH
GOTO CUTCYCLE

FINISH:

J2,12.5+9.3*(&N-1)-2,1
MZ,0.045
MY,1.5
JZ,.15

J2,12.5+9.3*(&N-1)-2,0
MZ,0
MY,14
JZ,.15

J2,12.5+9.3*(&N-1)-2.5,13
MZ,0
MX,12.5+9.3*(&N-1)-2
JZ,.15

zeykr
02-23-2013, 10:35 AM
Or it can be as simple as:


BEGIN:
code......
code....
code....
code....

J2, 48,24 'move out of way to load new part
PAUSE ' wait for a key press
GOTO BEGIN

adrianm
02-23-2013, 10:38 AM
The sample nest file (s_nest.sbp on the latest versions) that comes with SB3 in the sbparts folder works well as a tutorial for this sort of thing.

tom_fiddler
05-10-2016, 12:45 PM
Or it can be as simple as:


BEGIN:
code......
code....
code....
code....

J2, 48,24 'move out of way to load new part
PAUSE ' wait for a key press
GOTO BEGIN

Thank You, Thank You, Thank You !
Works great! Saving me a lot of time as I do many parts with repeat toolpaths.

BrandanS
05-10-2016, 01:29 PM
Sorry in advance for the necro posts:

You can also use the FP command to REALLY simplify things. I use FP to simulate what CNC programmers would recognize as Workset Co-ordinates (ie. G54, G55, etc). Make sure specify a path if the file is not in the same folder as the main file. In essence, I have a "Masterfile" with all the offsets, which call my subroutines.

Here is an Example of my code:

***

'11.5311 length part
'Nested for 4-Up operation (Stations 1-4)

'SB Side: A

'Define Variable (File Name)
'File Names
&OP1 = Radius Drill Mill Rev2
&OP2 = LH Notch
&OP3 = 150 mill drill mod for centre drill

REPEAT:

SA
SO, 1,1

&Tool = 1
C9

'*********
'Part 1-A
'*********

'Run Radius
VO,1, 0, 0, 0
FP &OP1

'Run Notch
VO,1, 0, 0, 0
FP &OP2

'Run Holes
VO,1, 0, 0, 0
FP &OP3

'*********
'Part 2-A
'*********

'Run Radius
VO,1, -4.125, 0, 0
FP &OP1

'Run Notch
VO,1, -4.125, 0, 0
FP &OP2

'Run Holes
VO,1, -4.125, 0, 0
FP &OP3


'*********
'Part 3-A
'*********

'Run Radius
VO,1, -8.250, 0, 0
FP &OP1

'Run Notch
VO,1, -8.250, 0, 0
FP &OP2

'Run Holes
VO,1, -8.250, 0, 0
FP &OP3

'*********
'Part 4-A
'*********

'Run Radius
VO,1, -12.375, 0, 0
FP &OP1

'Run Notch
VO,1, -12.375, 0, 0
FP &OP2

'Run Holes
VO,1, -12.375, 0, 0
FP &OP3

SO, 1,0

'Go Home (or load position)
J2, 18.000, 25.000

'PAUSE UNTIL(5,1)
'GOTO Repeat


****

Where &OP1, &OP2, etc are my subroutine names. Placing them as variables means I only have to change the file name once. This allows me to quickly drop in a revision change.

Make sure your subroutines end with a VO,0 to cancel the previous offset

Also, the PAUSE UNTIL(5,1) is a push button (Normally Open contact wired to Input 5) which in turn, becomes my START CYCLE button.

I can use this as a template as well, standardizing how to make minute adjustments, which is quite useful for my team.

If you are interested, and have any questions, I would be happy to help!

Brandan

Mayo
05-16-2016, 05:45 PM
Rather than get involved with programming language which tends to confuse me, here's what I do -

My design program allows me to duplicate toolpaths, so after creating the initial design, I duplicate everything (with offsets) on one sheet. Or multiple sheets if need be. I can manually select the cutting order for efficient travel. Then when saving the toolpath or shopbot file I name it to reflect how many pieces are cut within that file.