Hi all, Last week I posted a thing about using old methods in code generation. Another old method I still see being used is the use of the @FXD sections. And how about something that doesn't get used much - JOS tags and table variables. (perhaps explaining table variables would be a good, separate topic?)
I thought I'd post a snippet of a fictitious template file that uses this newer stuff, with some descriptions. I'll explain further what this is doing later. Here we go ... /////////////////////////////// @DECLARE #TBL #geometry // Declare a user table variable. #DEC #mypeck // Declare a variable used for a peck value. @ @START % #ONBLK @ @TOOLCHG G80 @ @END G80 M30 #OFFBLK% @ // This used to be @FXD5 - peck drilling operation. This one is set up // for two types of peck, explained below. @OP_PDRL // Get the JOS tag value for Step - Operation - Coolant. // (page 175, Customization Guide) #EVAL(#COOLNT=jos(coolant)) // Get the JOS tag value for Cycle. // Use Cycle 1 for chip break (G73), Cycle 2 for full retract (G83). #EVAL(#CYCLE=jos(cycle)) // Get the JOS tag value for Step - Tool - Geometry. // Use this to lookup up peck amount for G73. // G83 will use the amount from the SMF file. #EVAL(#GEOMETRY=(jos(geometry)) // Output the system table variable #COOLNT // The value is obtained from the global table @COOLNT < #COOLNT> // If Cycle = 0 // use the system table variable #CYCLE to get "G73" from the local // table. Use the user table variable #geometry to get the peck // amount from the next local table. Note that in order to get the // "right hand" value, the #TABLE function is required. #IF(#CYCLE=0)<#EVAL(#mypeck=#TABLE(geometry,#geometry))> // Cycle is not 0 // so get the "G83" from the local table, // but use the SMF value from question 150 for the peck amount. #ELSE<#EVAL(#mypeck=#PECK)> // Output the canned cycle. (this IF, ELSE, output set can be done in // two lines, see below. < #CYCLE>< R#CHKD J#mypeck Z#ZDPTH F#FEED S#SPEED #SPNDL> // Output the hole location. < X#XPOS>< Y#YPOS> @@ // Local table of @OP_PDRL accessed by the table variable #CYCLE. @@CYCLE 0,G73 1,G83 @@ // Local table of @OP_PDRL accessed by the table variable #geometry. @@geometry 0,.05 1,.15 2,.1 @@ // End of the @OP_PDRL section processing. @ // Global @COOLANT table. // #COOLNT will access this table if the section it is in // does not have a local (@@COOLNT) table of its own. @COOLNT 0,M09 1,M07 2,M08 3,M08 4,M08 @ /////////////////////////////// The IF, ELSE, Output set, above, can be done in two lines, as follows: #IF(#CYCLE=0)<< #CYCLE>< R#CHKD J#geometry Z#ZDPTH F#FEED S#SPEED #SPNDL>> #ELSE<< #CYCLE>< R#CHKD J#PECK Z#ZDPTH F#FEED S#SPEED #SPNDL>> OK, this template will output a different type peck (chip break or full retract) depending on how the Peck Drilling operation page Cycle is set. For Cycle = "Cycle 1" a G73 is used, and for "Cycle 2" a G83 is used. If a G73 (Cycle 1) is used the template looks at the tools geometry (on the Tool tab - Tool Geometry) and uses a set of peck amounts based on that. If it is a full retract G83 it uses the peck amount from the machine file. Enjoy ... and Cheers! - John Gent McKenzie River Software ====================================================================== To find out more about this mailing list including how to unsubscribe, send the message "info mfg-smartcam" to [EMAIL PROTECTED] ======================================================================
