Re: Calling Subprograms
This reminds me of "sub-routines" that we used in programming "Basic". Of course that was donkey's years ago!
Question: I have seen the use of "wizards" for performing different functions on a mill. Would that be a form of sub programming?
BTY, this is great stuff. I don't actually own a mill. I intended to convert an SX2 later this year. Seeing what can be accomplished by participating here may cause me to accelerate my schedule!:goodjob:
Being able to call subprograms is a useful tool, because it helps speedup the writing of programs, Sort of drag and drop feature, let`s you assemble programs with existing programs and standardize. How it can help us? Well, imagine you need a program to make a part that has a profile and holes that will be tapped. From our previous examples, you recorded the following programs: Heading, drilling and tapping. So you just open the heading program, save it with different number (the part number is wise) and call subprogram drilling, then call subprogram tapping. Then you go to the subprograms and only edit the X and Y, the depth and cutting parameters, same for tapping. This assures fewer mistakes, forgotten codes and let`s you call different programs as needed.
Let`s see how ist`s done.
We call our heading program, I will use real numbers instead of the #.
O2959
%
G15 G17 G40 G49 G80;
G20 G54;
G91 G28 X0.0 Y0.0 Z0.0;
M06 T1;
M03 S1500;
G90 G00 X0.0 Y0.0;
G43 Z10.0 H1;
G00 Z0.5 M08;
G99 G82 R0.3 Z-0.5 P200 F3.6 L0; (Here we call a drilling cycle with dwell, the L is used to specify how many times we need to repeat the cycle)
M98 P3545; (Here we call program O3545, in our case let`s think it`s the cartesian array of holes we did, I will write it at the bottom only for reference, you do not need to write it, it should be in the memory of the CNC)
G01 Z0.5;
G04 X10.;
G00 Z10. G40 G49 M09;
G91 G28 Z0.0 M05;
G28 Y0.0;
M01;
M30;
%
Subprogram O3545
%
O3545
X5.8 Y2.3;
X8.0;
Y8.0;
X3.4;
X1.2 Y6.0;
G80 M09; (Drilling Cycle Cancel)
M99; (Subprogram Cancel )
%
With this tool, You can just edit where the holes are, and forget about all other things.:whistle:
This reminds me of "sub-routines" that we used in programming "Basic". Of course that was donkey's years ago!
Question: I have seen the use of "wizards" for performing different functions on a mill. Would that be a form of sub programming?
BTY, this is great stuff. I don't actually own a mill. I intended to convert an SX2 later this year. Seeing what can be accomplished by participating here may cause me to accelerate my schedule!:goodjob: