calling subroutines

More
17 Mar 2023 19:30 #266936 by tommylight
Replied by tommylight on topic calling subroutines
linuxcnc.org/community/
All the info there.
Although i still can not get what exactly you want to achieve, but i will give it another go:
-make a VCP panel with buttons that call gcode files
-those gcode files should contain the frequently used shapes
That simplifies things a lot for production, does not help with "one off".
The other thing you mentioned, aranging cuts, that is done in CAM, and so far i have resorted to not using any, from experience with some simple "aranging" for plywood cuts, it works but not always efficient. 3d printer slicers also fail miserably to position objects properly on the bed.
Some nesting software does quite good from limited experience, but still need a bit of hand editing sometimes.
So that is best done the old fashined way for simple stuff.
Or have i missed something?
The following user(s) said Thank You: foam man

Please Log in or Create an account to join the conversation.

More
18 Mar 2023 01:51 #266958 by foam man
Replied by foam man on topic calling subroutines
I'd like to give the VCP panel a shot for a couple shapes I have in mind, I guess there is documentation on that in the GUI index?

I'll try and explain what I know people are doing. Not with Linux, but I don't see why not.

My business is manufacturing SIPs. My EPS cutlist will contain 30 different shapes. Although all the shapes are rectangular, I have 30 different widths to cut out with varying numbers of each. The foam blocks come in 3'x4'xbetween 8'&16'. The way I was taught by the guy that sold the foam cutter is.
Plan the block, draw pieces in 2D with spaces between exactly as they are going to be in the block, essentially nesting them. All the pieces have an 1-1/2 wire chase through the center. 2 if it's over 24". Those need to be drawn in there as well making sure that the path from the uotside edge,in to the chase is more then your wire kerf is set to. Export that as a DXF and load into DeskCNC where the post hangs out, tell deskcnc in which order you want those 12 pieces in the block cut, ( because it has to cut from the top down, and unlike a machine witha vertical axis, it can't just lift of and go cut something else) and load that Gcode file into Linux.

Works, but it's slow and I don't like it. Mostly because I know of a better way.

The guy I know with the Frogwire has the same programs written that I do (albeit in it's language). He has 1 main program where all his other programs that he might need to finish the block are declared at the top of the program and through a series of WHILES and DOWHILES and whatever else he can plan the block in minutes, load that file and start cutting the whole block start to finish.
Done.
My problem is I don't know where to begin with calling up a different program from the main one. I've seen the example in the GUI guide, and what andypugh wrote, but something is not clicking.
And then I saw in the GUI guide, a mention of declaring the filepaths for subs in the Hal file. So I think maybe I need to spend some quality trial and error time.

Unless someone has some ideas.

Any help is appreciated
Thanks
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
18 Mar 2023 10:14 #266976 by tommylight
Replied by tommylight on topic calling subroutines
First part i know as i dealt a bit with it, having cut straight through already finished pieces, several times! :)
The second with the frogwire, that is nesting software and LinuxCNC does not have that.
Might give SheetCam a run as there is a free version with limited output, i think, but i doubt it will be as easy as you describe it.
And there is always the posibility of adding and modifying almost everything in LinuxCNC, so as a start, have a look at PlasmaC or QtPlasmaC that are included with LinuxCNC, in the "by machine" section of the selector.
Those have a simple CAM that can actually do a lot very quickly, from simple shapes to multiplying and rotating shapes and adding lines that you do need.
Pretty sure those can be added and modified to suit your needs and transfered to other GUI's.
The included Sims can be used without a machine or without installing by just booting from USB, so give it a go.
The following user(s) said Thank You: foam man

Please Log in or Create an account to join the conversation.

More
18 Mar 2023 20:50 #267031 by rodw
Replied by rodw on topic calling subroutines
If its 2D work, +1 for sheetcam. It runs on Linux and windows. Your workflow becomes creating seperate DXF for each of your blocks, then laying them out in sheetcam and generating the gcode.
The demo program is restricted to 180 lines of code so you should be able to put a few rectangular blocks in to test it.
Postprocessors are written in the Lua programming language
The only thing I'm not sure of is having a part on each side of the cut. I am pretty sure there is a setting for that.
ask on the sheetcam forum if you get stuck. Les might even write a post for you if you ask nicely and he does not already have one that suits.

Please Log in or Create an account to join the conversation.

More
18 Mar 2023 21:10 #267032 by MaHa
Replied by MaHa on topic calling subroutines
I made this example with subroutines. You can define which routine and the order
  • From line 1 to 308, there are for example 3 of your routines named by numbers. All 30 should be placed there in the same manner.
  • From line 315 to 359, if its on the list below, the parameter for the the routines are set, and its called.
  • From line 362 to 377, the mainprogram. The routines are called by set #101 and following to the routine number to be executed.
  • Preamble, offset, what moves in between the routines you need to find out yourself


Warning: Spoiler!
Attachments:

Please Log in or Create an account to join the conversation.

More
18 Mar 2023 22:48 #267035 by foam man
Replied by foam man on topic calling subroutines
thanks I'll give it a shot

Please Log in or Create an account to join the conversation.

More
17 Apr 2023 13:43 #269302 by foam man
Replied by foam man on topic calling subroutines
   
 

File Attachment:

File Name: Main_sub.txt
File Size:1 KB

File Attachment:

File Name: 1_2hlrect206.txt
File Size:5 KB

 

File Attachment:

File Name: untitled.t...4-17.txt
File Size:2 KB


Hi guys
I just wanted to share how my subroutine programs work out in the end

the way it works, I look at the cut list, figure out which pieces you need out of this block, go into main_sub and remove the slash in front of the programs you will need, making sure all the rest have a slash so that linux will not read them. For what I do, the height will remain the same for all the pieces per project so using the generalheight global variable works. Otherwise, make sure my widths all match  with my cutlist and cut the whole block. It takes roughly 2 min to plan a block and nest it, versus drawing up each block individually and creating gcode through a post

​​​​​​​thanks for all your help
 
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.215 seconds
Powered by Kunena Forum