I would just have my subroutines all call a separate subroutine that
initializes global named parameter.
So:
o<gene:Init> sub
  #<_gene:height> = 62
  #<_gene:chestSize> = 38
o<gene:Init> endsub

And:
o<gene:millFront> sub
  o<gene:Init> call
  (do all sorts of stuff using global parameters that have been setup)
o<gene:millFront> endsub

o<gene:millBack> sub
   o<gene:Init> call
   (do stuff for the back)
o<gene:millBack> sub

Regards,

Ken

[No nasty comments about a height of five-two and a chest size of 38.]
KL

On Mon, Aug 17, 2015 at 10:43 AM, Gene Heskett <ghesk...@wdtv.com> wrote:

> On Monday 17 August 2015 07:21:33 andy pugh wrote:
>
> > On 16 August 2015 at 18:52, Gene Heskett <ghesk...@wdtv.com> wrote:
> > > But as I contemplate adding another section to the code by way of
> > > copy/paste, with an intervening paragraph of setting new values for
> > > the 2nd tool, it strike me that either this code should source a
> > > config file, or it could become a callable SUB for the configuration
> > > controlling file.
> > >
> > > So, one, is it possible, and two, whats the prefered order and
> > > syntax?
> >
> > I think that it is optionally possible to access _the_ INI file from
> > G-code, but not a generic file.
> > http://www.linuxcnc.org/docs/html/remap/structure.html#_optional_inter
> >preter_features_ini_file_configuration_a_id_sub_ini_features_a
> >
> > So, if your INI contains [RS274NGC]FEATURES = 4 then you can use (for
> > example) #1 = #<_ini[AXIS_0]PGAIN> in the G-code.
> > Which probably doesn't achieve what you want. Note that "4" is a
> > bit-field, You would typically use 12 to enable HAL-pin reading too.
> >
> > I suspect that what you really want to do is use a subroutine. In fact
> > I alterd my Lathe GUI to use subs and params rather than HAL-pin
> > access, partly because of queuing behaviour.
> >
> > example
> >
> > O<cut_joint> CALL [6.35] [13]
> >
> > ...
> >
> > O<cut_joint> SUB
> > (DEBUG, I will cut #2 fingers with a #1 diameter cutter)
> > O<cut_joint> ENDSUB
>
> In my thoughts and since 90% of the variables are globally defined in the
> #<_name_of_var> style, subroutines have access to them once set without
> being passed.  They'll survive, in my tests, everything but a powerdown
> reboot!
>
> What I have in mind is making one nominally 300 line subroutine out of
> what I have, and control it by a small header file that sets these
> variables for various jobs, and once its configured to do that job, call
> the main program as a subroutine to do that version of the job.  This
> main subroutine also calls its own subroutines defined in this big file
> before use.
>
> The idea is to have a config file for carving the ends of an upper part
> of the box board that is the long side.
>
> And one to carve the mirror of that for the upper parts of the ends of
> the box that is the short side.
>
> One to carve the side/long boards of its base skirt
> One to carve the mirror in the end/short boards of the base skirt
>
> Thats 4.
>
> one, after a tool change, to do the 1/8" roundover of the top side of the
> long/side upper boards
> One, after a tool change, to do the roundover of end/short upper boards
> One, after the tool change, to do the roundover of the side/long base
> boards
> One, after the tool change, to do the inside, was bottom faces, again
> with 3 more variations.
>
> So 8 config files, all calling the same subroutine.
>
> Getting a precise cut with the bearingless point cutting roundover, on
> both faces will be a trick. It needs to cut a full 90 degree arc. 2 thou
> too deep in either x or z and it will be a lot of sandpaper to correct.
> 10 thou too shallow and the joints won't bottom well.
>
> Sequenced to do as much as can be done without removing the board from
> the jig, but it will have to be removed and turned over to do the
> roundovers on the back sides.
>
> This code should be able to do all that, simply by using the globally set
> vars in the calling file.
>
> And because the boards might vary in both thickness and width as they
> come S4S, but may have dried further before being shipped to me, I might
> have to do a different autozero than I am doing now by buying a
> reneshaw, and probing the top, and both sides (x direction) to ascertain
> the boards true width.  The code, if that is adjusted, self expands or
> contracts in the x axis to maintain the pattern it carves to exactly fit
> the board. But because that would effect the joint fits when the mirrors
> mate, I an inclined not to do that, but cut as if the board was 20 thou
> narrower, oriented in the jig so the resultant short cut is on the same
> edge of the board on both ends, and jointer plane it off to get
> instantly identical width boards (until the humidity changes of
> course :).  By then I hope to have them assembled, squared and glued up.
>
> There is also a separate operation, a thru hole for the assembly screw in
> the center of each finger, with a 5/16" deep circular counterbore for
> the screw head, and a 1/8" deep square pocket a few thou wider than the
> counterbore that a contoured top Ebony button will be glued into.
> Screws to be pilot drilled thru the predrilled holes and installed while
> the glue is still green if possible.
>
> At least thats the plan at this stage. I have one chest I built last
> winter on the small mill which needed a lot of manual help and used
> every last mm of its x axis, and 4 boys left, so 3 more to do yet.
>
> I won't have the roundover bits till the end of the week, so at some
> point, I am going to chisel off the left edge stopper of my jig as its
> too short, and glue on a much longer wheelbase strip of white ash and
> machine it square as I seem to be getting some rocking on the shorter
> version.  How much longer depends on the max Y of the table, the ball
> screw conversion cost me some motion because the stem of the ball screws
> nut holder hits the end of the slot in the base coming forward, and the
> swarf shielding rubber gets in the way of full away from me movement.  I
> have some bellows material that may make that less of a problem, but
> haven't investigated installing it instead of that huge and thick rubber
> sheet furnished that "tents up" leaving the Y screw somewhat exposed.
> Built by lowest bidder crap. :(
>
> The lid is 2 ea 2x12's edge glued, using biscuits as close together as
> practical, and to prevent warpage, will have "breadboard" ends made from
> (believe it or not) Gibson guitar mahogany neck blanks that weren't
> quite up to snuff due to the lay of the grain & thrown out by the shop
> that makes them for Gibson right here in these here hills of WV.  I have
> a friend and ex employee who lives over in that neck of the woods who
> checks their burn pile and scarfs them up about weekly for his own
> projects.  Same exact stuff Grizzly has in their catalog at $75-$175 a
> stick!  I can usually make both breadboard ends from one neck blank.  It
> seems almost criminal to burn it, but if we don't get it, that is
> exactly what that shop will do when the pile gets big enough.
>
> Bottom is mahogany faced plywood, with a 5/16" wide groove to hold the
> cedar planks for the lining, and the box edges capped with mahogany
> strips with a matching 5/16" groove for the tops of the cedar planks.
>
> Thanks Andy. I was pretty sure it could be done, but you've confirmed it.
>
> Cheers, Gene Heskett
> --
> "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author)
> Genes Web page <http://geneslinuxbox.net:6309/gene>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
Kenneth Lerman
55 Main Street
Newtown, CT 06470
------------------------------------------------------------------------------
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to