View Full Version : Calling a subprogram that has subroutines


Shizzlemah
02-27-2007, 03:20 PM
Guys,
Is there a way to have program A run program B if program B has some subroutines in it ?

I am using DNC to do a complex profiling operation, and a second program to drill some bolt patterns and mill a few simple grooves.

The manual says that the subprogram can't use any "L" subroutine calls - but is there a way around it ?

Hoping to not have to rewrite the subprogram, as it gets changed often as to what parts get which of those features.

Thanks in advance

HuFlungDung
02-27-2007, 08:47 PM
Most machines running in DNC mode are not running from memory, so the code comes in, gets executed and is discarded. So, jumps cannot be carried out unless your DNC software is smart enough to actually go and fetch the code when it encounters a jump command, and yet should not actually send the jump command to the cnc.

Write the program out longhand is the best way, IMO, using CAM makes this not too onerous to carry out.

Neal
02-28-2007, 09:25 AM
HuFlung is correct. Sub-routines require the control to look backwards in the control. In DNC mode this can not happen. However you can use a "SERVER" style of programing. Here is a sample:
M6T1 (Main Program
G0G90G80G17G40S3000M3
G0E1X0Y0
H1Z.1
G1Z-1.F150.
C:\Fadal\Programs\SUB 1.NC
G0E2X0Y0
C:\Fadal\Programs\SUB 2.NC
G0E3X0Y0
C:\Fadal\Programs\SUB 3.NC
G0G90G80X0Y0Z0H0E0
M2

All of the sub programs reside in the folder listed in the data path. Also, if you use "N" words the Data path lines do not have an "N" word on it. This program can be run DNC

I hope that this makes sense!

Shizzlemah
02-28-2007, 11:59 AM
Ok I think I understand a little better, but maybe wasn't clear.

I am DNC'ing program A, but running program B (w/subroutines) from the Fadal's memory. Adding the last line to program a "M98 P6533 L1" will skip right over o6533 and I assume that is because 6533 has a bunch of subroutines.

Neal,
on your example, would I enter that program into the Fadal or DNC it? will it load&send the .NC files over RS232? Or will the fadal recognize the C:\xxx and call for a file via RS232?

Looks like the ticket, but I don't completely get just how it works or why it wouldn't just barf on those lines in the program.

Neal
03-07-2007, 02:44 PM
The example that I posted would reside completly on your PC and would be run DNC. Any sub routines would need to be change into subprograms. The difference is that you access them via a data path rather than an M98 call.

Neal

JR1050
03-25-2007, 08:13 PM
On the Fadal you cannot call a program with inbedded subroutines as a subprogram.Go back and make all your subroutines subprograms and call them with m98.YOu could also edit them into seperate files and call them from the pc memory in the way described above.It might be possible to make your sub routines all sub programs and run your main program DNc and call your subs up from the Fadal memory(using M98).Back in the day,when you had no memeory and a lot to do ,you wrote subs that you looped,put them in the control memory and made a main program call up tape and ran it off the tape reader...You can buy a 160 gig hard drive for 80 bucks,but a 64 k memory board still costs 2500!

gar
03-25-2007, 09:04 PM
070325-2059 EST USA

There should be no good reason that the software designers could not have provided a means to process a G65 subroutine call from DNC code to a resident O-number program in machine memory. If you can not do this, then the authors just did not think of this as a useful capability.

.