On Tue, 2010-05-18 at 12:30 -0500, Jon Elson wrote: > dave wrote: > >> > > Maybe this is a gentle hint to stay with linear programs. KISS > > has its advantages. > > I do a lot of work with a few lines of C to write G code. > > Yes it generates lots of lines but to my simple mind an easier way to > > go. ;-) > > > Well, but, but, splutter..... I have all these nice little programs > that write the G-code for particular things like slots and holes. > And, I had 24 identical slots to cut in a panel. It seemed so LOGICAL > to make this a subroutine and just position to a corner of each slot and > turn the subroutine loose. This way, the coordinates were all clumped > together, only given once, and I could visually inspect for typos. > I could have edited the program to comment out the first couple 2-line > pairs for the slots I didn't need to cut again, but it was easier to > just re-run the whole program. > > To make it a linear program, I would have had to run the slot generator > program 24 times and type in the coordinates each time, then combine the > output of these 24 program runs into one file, editing out the M02's. > Manually typing in the coordinates that many times, I would have made a > typo for sure. By editing it the way I did, it made it possible to > check it carefully and also duplicate and edit the coords to reduce the > chance of error. This part of the program would have expanded from > about 60 lines to about 600 lines. > > So, what DOES the interpreter do when you give a run-from-line and that > line is a G01 move, and the next line is a subroutine call? > It appears to have skipped BOTH of these lines, which just seems > bizarre. If it performed each G01 but skipped over the subroutine, that > might make some little bit of sense. But, it appears to have even > skipped the first G01 move, on the specified run-from line, which is > hard to explain. > > > Jon > I guess I think in a absolutely linear fashion. Slots, for me, are equally spaced so a loop does them nicely. If not then one can always put the offsets in an array and pick them off. Much easier to edit and check.
Linear code is cheap if it works. You are way too bright to do it the hard way. :-) Maybe engineers just enjoy beating their head against the wall. ;-) However, all of us have individual ways to approaching problems; I'm not about to say that my way is right; it is just simple minded enough for me to make it work. As for the rfl ... subroutines appear to be a real stumbling block. Life is NEVER simple. Dave > ------------------------------------------------------------------------------ > > _______________________________________________ > Emc-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers ------------------------------------------------------------------------------ _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
