Subroutines

Discussion/questions about software used with your CNC Shark and programming issues

Moderators: al wolford, sbk, Bob, Kayvon

Post Reply
User avatar
gmm50
Posts: 46
Joined: Fri May 16, 2014 5:22 pm

Subroutines

Post by gmm50 »

I would like to use subroutines to cut multiples of the same part.
I've read about templates but can't make that do what I want.

I want to design one part, make it a subroutine then place that part 10 times on my material and generate G code to run.

Reasons:
I want to make changes to only one of the parts.
We loose power quite frequently. So When that happens I would have some number of completed parts and some amount for unused material. Hopefully only 1 part is trashed.

The G Code I see generated seems to be absolute so that is a bit of an issue making it more difficult to use as a subroutine.

Thanks in advance.
George

tonydude
Posts: 1581
Joined: Tue Aug 17, 2010 9:23 am
Location: Buffalo,NY

Re: Subroutines

Post by tonydude »

Use the array tool.
array copy icon.PNG
array copy icon 2.PNG


Tony
question mark.PNG
also click on the question mark for how to do it
Buffalo,NY

"What will matter is not what you bought but what you built; not what you got, but what you gave”

Aspire 11.015, photo vcarve, cnc mako shark extended bed with the new upgraded HD 5 gantry with Led pendent.

User avatar
Kayvon
Posts: 552
Joined: Tue Oct 21, 2014 11:46 pm

Re: Subroutines

Post by Kayvon »

In addition to the array tool that lets you create several copies of the same design, it looks like you're trying to resume where you left off if there's a power failure.

The simplest way to do this is to create a design with the array tool that TonyDude showed you and run the entire thing. If a power failure occurs, reset the machine back to its origin, edit the design file to delete the completed portions, and have it run the new file. The new file will skip the completed portions because you deleted them and work on the parts that still need completing.

G-code doesn't have "subroutines" as you've called them, so any solution will involve editing the g-code directly or changing the design file. Changing the design file like this seems like the simplest way.

Post Reply