Post-Processor Variables - @@LOGICAL@@
Cadfil Help contents Cadfil.com Home
In the post processor block definitions for the layout of SPF and MPF there are numerous logical variables that can be used. These have the format @@NAME@@ for example @@LAB-AX-1@@. In this case the LAB-AX-1 is the axis name label for axis 1 (the mandrel rotation). So if the mandrel rotation axis label has been set to 'A' then wherever @@LAB-AX-1@@ is specified the value (in this case 'A' will be applied).
The structure of the NC data is made up from a number of 'block definitions' as listed below. Each of these can consist of multiple line of code.
Sample SM files give more detail on this structure.
There are numerous logicals, some will be essential for creating a working program, some can be used to add optional information to the program for example @@CADFIL-VERSION@@ can be used to add the version of Cadfil being used to the program.
@@FEED@@ Current value of feed-rate or speed variable. Note that time variables are also available, see DTIME, WTIME and INVTIME
@@LINE-NUMBER-SPF@@ & @@LINE-NUMBER-MPF@@ These are the current SPF and MPF program line numbers. The first line in the main program (MPF) is set by the value $LINE-NO-START-MPF and the line number step is set by $LINE-NO-INCREMENT-MPF. For the sub-program file (SPF) the values are $LINE-NO-START-SPF and $LINE-NO-INCREMENT-SPF. @@LINE-NUMBER-SPF++@@ is the number of the next line i.e. the current line number plus the line number increment. The maximum line number the controller can support is set by $LINE-NO-MAX. If this is exceeded the first line number is then used thus it will not be unique!
@@LAB-AX-n@@ (where n can be 1 to 6) These are the names (labels) for axes 1 to 6
@@AX-INC-n@@ (where n can be 1 to 6) Is the current increment motion value for axis n
@@POS-n@@ (where n can be 1 to 6) Is the current absolute machine position value for axis n
@@SPOS-n@@ (where n can be 1 to 6) Is the absolute machine position of the very first position (the start position) for axis n for the current sub-program being processed.
@@MODPOS-n@@ (where n can be 1 to 6) the same as POS-n however the value is forced in the 0-360 range. This is primarily used for start positions for the mandrel axis (MODPOS-1) for non-round parts. It maybe that the mandrel axis is a modulo axis e.g. G90 A 361.0 is the same as G90 1.0 and G90 A -1.0 is the same as G90 A 359. Some CNC configurations do not like negative absolute values for a rotary axis or have problems with G90 values greater than 1 rotation. This feature was added at V9.01 at some future point if needed a feature to set the 1 rotation limit to values other than the 360 default value can be added. This feature is only useful with axis numbers 1-3 as 4-6 are usually linear axis.
@@MODSPOS-n@@ (where n can be 1 to 6) is the same as MODPOS-n but uses SPOS rather than the POS value
@@NO-PASSES@@Is the number of circuits for the current SPF
@@NO-SUBS@@Is the number of subprograms or the number of payout files in a combined winding file. For post-processing an individual payout file it will have a value of 1.
@@CADFIL-VERSION@@ The current Cadfil version e.g. 7.35
@@DATE@@ Gives the value windows reports for current date and time in the following format 06-NOV-07 08:38:07
@@MDF-NAME@@ The name of the post processor configuration (.sm file) being used. Please note that as of Cadfil 9.17 the variable has been deleted and will give an error. @@CONFIG@@ should be used instead. for more information on the error caused by this, see the Config redundancy error page.
@@SPF-NAME@@ The name of the current SPF (often the current payout file name)
@@MPF-NAME@@ The name of the MPF
@@CTL-FILE-NAME@@ Name of the CTL file when multiple layer programs are being processed if there is no CTL file this is the name as @@MPF-NAME@@
@@Qn@@ (where n takes the values 1 to 4) These are the 4 terms of the quaternion function for post-processing using a industrial robot. The four Q values Q1,Q2,Q3& Q4 define angular the orientation of the payout eye (robot tool).
@@BLANK-LINE@@ Adds an empty line (a line with a single space)
@@TENSION-VALUE-n@@ (where names takes the value 1 to 3) In the sm file there user can define up to 3 tensions values. For example these could be high medium and low tension. This function inserts the value of tension defined.
@@RMAX@@ Maximum radius in the current mandrel (only valid for axisymmetric mandrels)
@@RCLR@@ Default mandrel clearance distance from current payout file
@@BLOCK-START-POSN@@ This is a special logical which is found in the MPF block definition and inserts a line or number of lines that define the start point and subroutine call for the SPF. This is defined as a separte block as a program with multiple subprograms will use this block several times. To understand this function is is easier to look at a working example of an SM file.
@@PAY-FILE-NAME@@ Name of current payout path file
@@BANDWIDTH@@ Width of the fibre band for the current SPF (payout file)
@@XDAT@@ Mandrel Xdatum value
@@USER-NAME@@ Name of the logged in user reported by windows
@@FIRST-SPF-ONLY@@ This is a special function variable. In the program block definitions any line containing this value will only be processed on the first occurrence (ie the first subroutine). This could be used for example in the start position block to have a stop code (NC - M00) for the first SPF start only to tie in the fibres.
@@FIRST-SPF-EXCLUDE@@ This is a special function variable. In the program block definitions any line containing this value will NOT be processed on the first subroutine but will for all subsequent subroutines and is the opposite of @@FIRST-SPF-ONLY@@.
@@DTIME@@ Incremental time for current motion.
@@INVTIME@@ Inverse Incremental time for current motion i.e. 1/DTIME this is the output variable if the CNC uses the old style 'Inversere Time' speed control often under G93 in GCODE
@@WTIME@@ Current winding machine time from start of program to current position.
@@TOT-FIB-LEN@@ Total length of fibre wound in the program
@@P38-REVS-BEFORE-COOLING@@ These 'P38' parameters are specific only the the tape edge winding parametric program and are documented elsewhere.
Pipe Winding Parameters, see the help file section on these programs
@@PW-MANDREL-RAD@@ The mandrel radius at the start of the program.
@@PW-CLEARANCE-RAD@@ The Clearance Radius for the machine.
@@PW-START-POS@@ Start position from chuck datum.
@@PW-WIND-LENGTH@@ Length of pipe to be wound
@@PW-WIND-ANGLE@@ For a multi-layer pipe program the winds angle my be different for each layer so this parameter is best included in the start position block or the SPF header block.
@@PW-WIND-LAYER-NO@@ This parameter if used should be included in the start position block or the SPF header block.
Please note that for a pipe winding program with more than one layers the 'mandrel' radius (and other parameters) changes with each layer. If these parameters are used in the main MPF block the value that is used will be for the last SPF! It is better to use these parameters in the start position block, perhaps using the @@FIRST-SPF-ONLY@@ if the data is not required for each layer. Some parameters will probably be required for each layer such and wind angle.
@@RESIN-NAME@@ and @@RESIN-TYPE@@ These parameters relate to the fibre & resin properties from the materials database that have been saved in the current payout file.
The current estimate of the mass of resin used during winding, assuming the user has selected the correct material parameters. The fibre amount is known. the resin is from the specified resin fraction & resin density. Caution, this will be the current value and it is cumulative. If you have this at the end of the MPF it will be the total. If you have after each layer it will be the current value and will increase layer by layer.
@@MASS-FIBRE@@ The current estimate of the mass of fibre used. See @@MASS-RESIN@@.
@@MASS@@ Current wound mass of composite. It is equal to @@MASS-FIBRE@@+@@MASS-RESIN@@.
@@ANR08@@ The payout file is a set 3D motion coordinate data that is converted into NC motion for a specific winding machine
by the post-processor. The payout file may also contain some ancillary records
that direct the post-processor to perform some additional action.
Ancillary records take the format ANRxx where xx is a number any then may have
some other data that follows. ANR08 appears with the line:
ANR08 ; previous point was hoop point
If the user wishes an action can be associated with this event, for example every time a hoop (turning) point is reached by flipping a fixed stop payout eye rotation that can be found on some older machines that do not have a programmable payout eye rotation. This works as follows , set the output for the NC machine with the SM file variable $ANR08_HOOP_ACTION_TXT1=. For example $ANR08_HOOP_ACTION_TXT1=M88 outputs the code M88 which could have been set on the CNC to perform a specific action. In the SM file we our then add @@ANR08@@ to the blocks $BLOCK-SPF-START, $BLOCK-SPF-MIDDLE and $BLOCK-SPF-END that are used for sub-program motion data formats.
Note we now have $ANR08_HOOP_ACTION_TXT1 and $ANR08_HOOP_ACTION_TXT2 which are used alternately
to allow for the set and unset code to be different. For example:
$BLOCK-SPF-START=@@LAB-AX-1@@@@AX-INC-1@@ @@LAB-AX-4@@@@AX-INC-4@@ @@ANR08@@
Each time the ANR08 appears in the payout file (at the turning points) the codes @@ANR08@@ would be replaced by M88 and at all other times it would be replaced by null text (i.e. removed). If $ANR08_HOOP_ACTION_TXT1 or 2 is not set in the SM file then there will be no output as it will by default be set to a null string.
@@TSW-1@@, @@TSW-2@@, @@TSW-3@@ these allow the output of twist , shear and wrap angles on the payout eye/roller (in degrees) for each line of the NC program and are discussed in more detail "here."