Post-processor configuration-machine data file (.SM)

HelpCadfil Help contents Home

At version 7 and later all post-processor configuration is in a file with the .SM extension. The .SM file is a text file that can be viewed or changed using a text editor such as Notepad. At Version 9 there is also a facility to review and modify the SM configuration data within Cadfil using the Show Post-Processor Configuration Data menu option on the NC Post Process menu option. The configuration data is made up of 3 pages, there is information on this page to help understand page 1 and page 2. The following link also describes the SM editor option. If you use notepad set Word Wrap off on the Format menu. New features have been continuously added to the SM files with subsequent Cadfil version updates. The SM file is found in the Cadfil install directory. When Cadfil is run a file called is always read but the a command line argument can be added to the Cadfil start shortcuts to specify a SM file name, the syntax for the command line is /machine There is also an option to browse and select an SM file from a menu option on the NC menu. If on reading the .SM there are errors in it there is than an option to view the error log which will identify the problems. If there are errors in the file all the post-process options will be greyed out, that is, you will NOT be able to post-process.

Cadfil Shortcut Properties

In the above picture we have right clicked the Cadfil shortcut found on the desktop or start menu. We are looking at the Shortcut tab and in the Target box you will find some text like C:\cadfil\Cadfil923\Cadfil923.exe /lang lang_en.txt /machine /head standard_payhead_def.txt, you can set default language, SM (machine configuration) and payout head definition files here.

On the NC-Post Process menu there is a select winding machine option which allows the selection of a different .SM file, Thus if you have two different winding machines you could have and Each time you post-processes the text The Active machine configuration is > is displayed in the text window so you know which configuration is in use. There is also an option to ALL view the current SM file settings from and option on the NC Post Process Menu

If you change a .SM file while CADFIL is running you need to exit or re-select the .SM file using the select winding machine option to ensure the changes are being used.

The SM file contains comments describing all the parameter and variables in it. A number of sample files are usually supplied. It is normal for CCL to configure the file to the best knowledge we have available at the time the software is supplied. We can offer technical assistance on this if required, please ask!

If you are unsure do not modify the SM file and always make a safe copy of the original file before changing it. There are three types of data i n the SM, system constants which are $ variables i.e. $constant-name some of these parameters are described below. There are some $constants that define the program layout and this can contain @@variables. These variables have the format @@variable-name@@, for example @@DATE@@, during the post-process run time this variable would be substituted for the current time & date. A list & description of @@logicals can be found under the topic post processor logicals.

Post Processor Configuration Page 1

Axis Labels - $LAB-AX-n These are the text that gives the names for each axis on the controller, for example A,B,C,X,Y,Z. The labels can be more than 1 character long.

Axis Status - $AX-STATUS-n These take the value of -1, 0 or +1 depending on if the axis direction is positive, negative or not present if 0.

Output Format - $FORMAT-AXIS-n This sets the numerical output format for motion entries for each axis. For more information on the format options, see the Post-Processor Number Formats page.

Axis Offsets - $OFFSET-AX-n These values for each axis (n=1 to 6) from the machine reference point (machine 'home' position or payout origin) to the spindle datum. The offsets MUST be in machine units and have the CORRECT SIGN. They are the values one would use to instruct the machine to move (crash!) the centre of the payout origin (the position were the payout eye is attached), to the spindle datum point. These offsets are constants for the machine, but may change when maintenance work is performed on it. The spindle datum point is a fixed point on the machine winding axis, this usually being located on the head-stock or tail-stock. When the mandrel is located in the machine, the position of the mandrel must then be measured from this point. Thus, the mandrel's position can be defined in the machine co-ordinate system vie the Xdatum post-process variable.

Click here to see a diagram for OFFSETS

Check Limits - $CHECK-LIMITS-AX-n
Minimum Limits/ Maximum Limits - $MIN/$MAX-POS-AX-n
See the Setting axis travel limits in the Cadfil Post-Processor page for a more detailed explanation.

Axis Scale/Gear - $GEARING-AX-n These are the ratios, which relate the units of the winding machine. The post processor uses rotational units of degrees, thus if an axis rotation of 1 degree corresponds to a rotation of 234.567 machine units then the scaling ratio would be 234.567. If the rotating axis units on the machine are degrees, then the scaling factor would be 1.0. For linear axes e.g. cross-feed these relate the units used to define the mandrel in Cadfil to those of the machine i.e. if the machine uses mm and the mandrel is specified in mm the gear is 1.0. It is strongly recommended that a system of units for the mandrel are adopted and then used constantly. This removes the need to change the scaling data in the configuration file once it has been set up correctly. In practice all customer use either mm or inch for the mandrel definition.

Null Increments OK? - $NUL-INCREMENTS-OK-n This supresses/enables the output of 0 incremental moves for the specified axis, some controllers require all axes to be present, and some controllers have been found to give jerky motion when an axis is present on some lines and missing on subsequent lines due to its contouring algorithm.

Feed Rate Scale - FEED-SCALE-AX-n This multiplies the contribution of a particular axis in the feed rate calculations to create some bias. This feature would not be commonly used so feed rate scale of 1 is common.

Small Move Limit - $SMALL-MOVE-AX-n: Significant axis motions for axes 1 to n. A value must be supplied for each axis on the machine. This function holds small incremental axis motions, until the value of the motion for an axis is greater than the significant axis motion specified for that axis. If values of zero ( 0.0 ) are entered then all motions are output, however small they may be. The values entered for each axis should be in the relevant machine units. If an axis is not present on the machine, a value should still be entered (0.0 for example), as six values are always expected. If these are set to zero for active axes, then there may occasionally be very small machine motions due to the numerical rounding errors associated with the generation of the path across the surface mesh. Such motions will not add to the accuracy of the winding of the path and may impair the smoothness of the winding operation. This feature is not used on the last line of a subroutine, hence ensuring there is no misclosure error of the payout eye position at the end of each cycle. All axes positions (except A), return exactly to the start position at the end of each cycle. If this was not the case, a program with a large number of cycles would progressively 'shift' the fibre track in relation to the mandrel in one or more axes during winding.

Maximum Axis Speed - $MAX-SPEED-AX-n: The user can specify a maximum feed rate for each of the axes, this can be used with the speed mode options to ensure no axis goes over-speed and can be used to optimise winding time. When graphics of speed are displayed these are as a proportion of the maximum speed for the axis i.e. 0.5=50% maximum speed.

; example uses deg/min and mm/min
; set all 6 axes even if machine does not have them

Maximum Axis Acceleration - $MAX-ACCEL-AX-n: This can set acceleration values for each axis which can help to create a smoother faster winding program. For this option to be active in the post-processor the option $ACCEL_DISABLED=0 must be set, this is NOT the default state. If $ACCEL-DISABLED=0 is set, there is a further option $ACCEL-CALC-OFF this sets the initial (default) state for the acceleration check box on the feed-rate dialog box during post process, the acceleration option is default on used if $ACCEL-CALC-OFF=0 is set. This last set can be over ridden by the user each time the post-processor is used.

;example of axis acceleration values 
; in mm/min/mm or deg/min/min example assuming machine can 
; go from 0 to max speed in 1/15 mins (4 seconds) thus accel = vmax * 15 

Post Processor Configuration Page 2

$CONFIG= this can my set to any descriptive name for the contents of the SM file e.g. $CONFIG=The big red 5 axis machine. The name set can then be output to the NC program files to aid traceability. In previous versions of Cadfil @@MDF-NAME@@ was used in the CONFIG options, which can cause the error "@@MDF-NAME@@ Redundant in SM use @@CONFIG@@. For help with his error message", see the Config redundancy error page

$MPF-FIRST-IN-NC. A standard G-code NC program file (<name>.prg) normally consists of a main program (MPF) and a series of sub-programs (SPFs) this option allows the MPF to be the first program in the prg file ($MPF-FIRST-IN-NC=1) or the last program in the prg file ($MPF-FIRST-IN-NC=0).

There are now further options, if $MPF-FIRST-IN-NC=2 then instead for creating <name>.prg the post processor will create files <name>.mpf and <name>.spf with the MPF and SPF data in them as some controllers require the two types of program to be separate.

With $MPF-FIRST-IN-NC=3 then instead for creating <name>.prg the post processor will create files <name>.mpf and one or more <name>.spf files. Thus every program unit is in a separate file. This mode can be useful for example on Siemens 840 controllers the SPF's can be accessed directly from the hard drive (using EXTCALL) without having to 'load them'.

With $MPF-FIRST-IN-NC=4 as option 3 above this splits the program into individual SPF files. The MPF is also created as an SPF file, this may be helpful if the main program needs to be integrated into a higher level HMI on the CNC.

Click here to see a flowchart showing the $MPF-FIRST-IN-NC options more clearly.

$SPF-NAMED-AS-PAYFILE This takes the values 1 or 0, the default is $SPF-NAMED-AS-PAYFILE=0 in this option NC subprogram and main programs names in the G-code are given by the use of numbers only as is common on many old type NC controllers particularly those compatible with FANUC style G-code. With $SPF-NAMED-AS-PAYFILE=1 Cadfil uses mpf and spf names the same as the ctl/.pay file names used in the earlier stages of program generation.

$SPF-FILE-EXT/ $MPF-FILE-EXT. As discussed in the sections above Cadfil can create a separate main program file (MPF) and sub-program files SPF's. By default these have the file extensions .MPF and .SPF. Sometimes the CNC or transfer software may have specific file extension requirements e.g. .NC , .txt etc or indeed no file extension. So do this we would set $SPF-FILE-EXT=NC or $SPF-FILE-EXT=txt of $SPF-FILE-EXT=
Please note that if you have mpf and spf with the same extension there are some combinations of $MPF-FIRST-IN-NC= and other options that could lead to 2 files of the same name being generated, or more specifically one being overwritten by the other so some care must be taken or seek advise for the experts if you have a problem.

$SPF-FILE-NAME-PREFIX On some controllers the name of sub-program files my require some prefix to the file name. An example is a LNC controller that was using sub-programs with numerical names (example O2345). The post processor can make the sub-programs with numeric names and you can code so the the main program references the sub-programs using the letter "O" prefix but to create individual file names with this prefix you would set $SPF-FILE-NAME-PREFIX=O . Another controller configuration we use all sub-program names must have the letter LA, so post-processing a .PAY file called myfile would generate a sub-program called LAmyfile due to the setting $SPF-FILE-NAME-PREFIX=LA. If you do no need a prefix do not set any value (blank) or comment out the feature with a semi-colon ";SPF_FILE_NAME_PREFIX="

There are several possible entries such as $FORMAT-LINE-NO=(I4), $FORMAT-TENSION=(F7.1) or $FORMAT-AXIS-1=(F12.2) that control how numbers are written to the NC data. this aspect is discussed in the topic, post processor numerical formats.Format line number just controls the layout of the MFP and SPF line numbers (if used) for example the controller might want 4 digits so leading zero need to be added, (I4) would give '1' or '1234' whilst (I4.4) would give '0001' and '1234' and (I6.6) would give '000001' and '001234'.

$LINE-NO-START-MPF sets the first line (block) number in the MPF (main program file).

$LINE-NO-START-SPF sets the first line (block) number in the SPF (subprogram files).

$LINE-NO-INCREMENT-MPF sets the line counting step the MPF (main program file). So if $LINE-NO-START-MPF=1000 and $LINE-NO-INCREMENT-MPF=10 the line numbers would go 1000, 1010, 1020, 1030

$LINE-NO-INCREMENT-SPF sets the line counting step in the SPFs. So if $LINE-NO-START-SPF=10 and $LINE-NO-INCREMENT-SPF=2 the line numbers would go 10, 12, 14, 16

$MAX-SUB-LOOPS: This sets a maximum number of sub loops for if the machine has a maximum number it can process.

$LINE-NO-MAX: This sets a maximum number of lines for if the machine has a maximum number it can process.

$ASK-MPF-NUMBER can be used if we are on a controller that uses numbers rather than names for mpf/spf units. If $ASK-MPF-NUMBER=1 Cadfil asks for the numbers to use for the main program, the sub programs are then numbered sequentially so if you give the MPF number as 9000 the SPFs would be 9001, 9002, 9003, etc. The default is $ASK-MPF-NUMBER=0 in which case the user is not asked and the default MPF number is set by the value of $DEFAULT-MPF-NUMBER= which if not itself set has a default of 0000.

$MAX-MANDREL-SURF-SPEED: (the maximum speed of the mandrel surface at the largest diameter (radius) in mm/min or inch/min dependant on units), however it is only considered if $MAX-MANDREL-SURF-SPEED-ON=1
For more information on this topic see the selection feed rate calculation method page

$ACCEL_DISABLED and $ACCEL_CALC_OFF determine if the acceleration calculation is used in the feed rate dialog. for more information see the selection feed rate calculation method page

$MAX-AX-3-INCR.The yaw axis moves the head on a circular path. The cross-feed and carriage axes have to make compensating moves. As the axes move on a linear path point to point, if the yaw angle is large the clearance of the dispensing point could temporarily increase or decrease during the motion. If clearances are small this could cause a clash with the mandrel. The max- increment can be set to 10 degrees for reasonable accuracy. Any larger yaw movements are then broken into smaller parts and the correct carriage/cross-feed motions calculated for each. If the max.-increment is set to >2*yaw axis limit the feature is fully deactivated.

$AX-3-ROTN-OFFSET: Machines with a yaw axis often have the rotating centre of the yaw not at the fibre dispensing point. When the head yaws the post-processor must compensate with cross-feed and carriage movements. The total rotating length from the dispense point to yaw centre is made up of the $AX-3-ROTN-OFFSET+POLEN. If there is no yaw axis, set the offset to 0.00

$KILL-WHITE-SPACE: To understand this function, see the Post-Processor Number Formats page.

$TENSION-VALUE-n (where names takes the value 1 to 5) In the sm file, the user can define up to 5 tensions values. For example these could be high, medium and low tension. This function inserts the value of tension defined where @@TENSION-VALUE-n@@ is called up in the sm file blocks.

$FEED-DEFAULT-START: This is the value of feed-rate that is used in the move to the start position in the NC main program.

$FEED-DEFAULT-WIND: This is the value of feed-rate that is used in the NC sub-program to wind the component. For more information on the $FEED variables, click here.

$MCCLEAN-PPAIR-ON: Takes the value 0 or 1. If the value is 1, the post processor outputs data in the McClean-Anderson Compositrak.seg format.

$PIPE-MAX-CARRIAGE-INCREMENT. The parameter is not strictly a post processor variable as it affects .PAY file creation for pipe winding (Multi-pipe, Pipe, Hoop, Multi-hoop). Where there is a long linear section of motion along the pipe with only 2 axes of motion (for example of a helical winding of a 12000mm long pipe there could be a 'linear' single motion block of 11000mm) this motion can be broken into a number of smaller motion blocks. If $PIPE-MAX-CARRIAGE-INCREMENT=1000 was set a linear motion on the carriage of 8900mm would be slip into 9 equal portions such than none exceeded 1000mm. On some machines this feature could be used to help in recovery from power failure or to help in motion smoothing, or to overcome some controller limitation. If the value is not set the feature is non enabled and is not used.

$AXIS-REVERSE-NC-MOD: Experimental option, do not use.

$LEN/$ROTN/TIME_UNIT_NAME: These 3 variables set the units for lengths, rotations and time. More information can be found on this page.

$PAYOUT-EYE-DEFAULT-LEN/$ASK-FOR-PAYOUT-EYE-LEN: These are discussed in the Entering the Payout Extension page.

$ASK-FOR-AX1-OFFSET: Takes the value 1 or 0. If set to 1, the post processor will ask for the mandrel rotation offset, which is an absolute value added to all absolute mandrel positions. Note that this is manually asking for $OFFSET-AX-1

$AX-2-TYPE-OFF Cadfil has numerous options for creating payout path file (.pay) e.g. Cadfil-Axsym, Multi-Hoop etc. Each of these options has a 2 digit identifier (payid) in the first line of the PAY file, for example Multi-hoop is type 30. Using this option the SM file can be configured such that certain types of payid when post-processed do not use the eye roll axis ( Axis 2) . For example when hoop winding with tape the axis might not be useful or effective. This option is one that is not normally used but in the example below axis 2 will be switched

$NC-TRANSFER-CMD-LN: These all relate to RS232 serial communication to an NC controller and are largely obsolete. See also the topic transfer software to the NC winder.

$SIO-OUT-LF: These also relate to RS232 serial communication to an NC controller and are obsolete.

$DWELL-SPLIT: Normally the dwell rotation is split equally (50:50) between the two turning positions in the program. The dwell-split feature allows the dwell to be biased between the ends 100:0 has all the dwell at the first hoop position and 0:100 has all the dwell at the second (last) hoop position. For more information on this topic see the dwell winding page.

$NEG-POS-BRACKETS-AX-2: Puts negative axis 2 positions in brackets(). Required on some controllers (ENTEC)

$ANR08_HOOP_ACTION_TXT2: There are codes "ANR08" automatically embedded in Cadfil pay files that indicate positions where turning (hoop) position occur in the path. If this options are set to a none null text then this will be output to the NC program. So for example $ANR08_HOOP_ACTION_TXT1=M21 and $ANR08_HOOP_ACTION_TXT1=M22 then the codes M21 and M22 would be alternately output to the NC data to trigger some external event.

$SM-FILTER-LENGTH/ANGLE: see the topic Filter Length and Angle

$THK2-XSTEP: Step used in TH2 thickness files, discussed in the topic Thickness data file.

For $NC-NO-CONDENSE and$NC-NO-MERGE see the topic Filter Length and Angle

$Kn-START/STEP The Cadfil post processor has three counting variables the user can use for any purpose. These are K1, K2 and K3. K1 is used as an example here but all are the same, use K2-xxxx for the K2 counter. In the SM file the user can define $K1-START= and $K1-STEP= which are the starting value and the amount of the increment when the counter is increased . In the SM file 'blocks' that define the NC program structure each time the @@K1++@@ variable is encountered the value of the K1 counter is increased by the value of K1-STEP (k1value=k1value+k1step). If for example you put @@K1++@@ in the start position block K1 would count the number of NC sub-programs. At any point in the program the current value of the counter can be output using the @@K1-VALUE@@ variable. If it were put in the sub-program line output blocks it would count the number of sub-program lines.

$QUATERNION-MODE: Quaternions can be used for tool orientation on ABB robots. Using ABB ORIENT function is preferred

$PIPE-TURN-MERGE-ALL: During normal parametric pipe winding there is a turning zone transition from the constant wind angle part to the turning point. Some machines, often PLC based control do not have the ability to process this progressive transition well. The option when set to 1 (rather than the default of 0) merges all the transition moves together. This is not an option to use unless you have to!

$EXPAND-NC-LOOPS takes values of 0 or 1, 0 is the default. If set to one ($EXPAND-NC-LOOPS=1) then NC sub program data is repeated so that instead of a sub-program with (for example) 20 program motion lines that is called 5 times we would get 100 (20x5) lines of motion data as the NC lines would be added 5 times over. This feature should only be used if the NC controller cannot support sub-programs or program loop (such as If, GOTO, GOSUB loop etc) as it makes the programs larger and harder to understand and modify if required.
It is important to note that 1 line of motion will be missing between each repeated layer when this option is used. To fix this, and additional line is required using $BLOCK-SPF-EXPAND= followed by a line of motion which may be identical to that used in $BLOCK-SPF-MIDDLE=.

$BEEP-OFF=1 silences Cadfil, if any beeps noises (on error for example) are annoying. $BEEP-OFF=0 is the default if it is not set.

$T11-CENTRE-AXn-COORD: see the Cadfil Elbow Winding parametric page.

$AX5-ZOFFSET: This is an offset that could be used to try to compensate for the problem where the Eye roll axis is eccentric to the fibre dispensing point from the payout eye. Thus when the eye rotates the payout position moves in the sense of carriage and vertical positions. Use with caution, a better way is to design a machine that doesn't have this problem!

'$USER-DEF-n' Where n is 1 to 5 can be used to collect together a series of commands or text that you want to use in more than one place in the program block definitions. So for example $USER-DEF-1=F @@FEED@@ @@LAB-AX-1@@ @@AX-INC-1@@ @@LAB-AX-4@@ @@AX-INC-4@@ (some text) so later you can specify @@USER-DEF-1@@ instead of a long sequence of variables. Often $BLOCK-SPF-START= $BLOCK-SPF-MIDDLE= and $BLOCK-SPF-END= repeat a chunk of the same data so these are good places to make use of this feature.

$KUKA-MODE: Default is 0 for not set, or can take values from 1 to 5. Uses different methods to establish roll and yaw rotations.

$TOOL-ASK: Set to 0 or 1. If 1 the post processor asks the user for a tool number between 1 and max tool number.

$TOOL-DEFAULT: Default tool number if $TOOL-ASK=0.

$TOOL-MAX-NUM: Defines the largest tool number, as used in B>$TOOL-ASK and $TOOL-DEFAULT.

$USER-SET-PP-OPT-OFF If the winding machine configuration (.SM) does not have a particular axis configured then any post-process menu option that need that axis will not be shown in the menu. It is possible for the user to deconfigure post-process menu options also, for example if you have a 4 axis machine you might never wish to use any of the 2 axis or 3 Axis post-process options. You will see that all the post process options on the menu have a 2 digit number in brackets at the end of the name eg (05), that is the option number. In the SM file you could have $USER-SET-PP-OPT-OFF=[01,09,05,08], this says do not show post-process menu options 01, 09, 05 and 08. The options must be 2 digits and separated by a single space or comma. The square brackets are required.

$VISU-STATIC-SCENE-STL-FILE: A default static scene can be set in the .SM file. The file "winder_bed_type.stl" is one of a number of example files in the Cadfil installation folder. for more information see the advanced graphics window page.

'$USR-PRMT-ACTIVE-n','$USR-PRMT-MSG-n','$USR-PRMT-TYPE-n' There are currently 5 user prompt variables that can be defined, the discussion that follows is for $USR-PRMT-ACTIVE-1 as an example. In the SM file if $USR-PRMT-ACTIVE-1=1 then then during the post process the user will be asked a question. You must define the question text in $USR-PRMT-MSG-1 so we have for example $USR-PRMT-MSG-1=Enter the heater setting (0-10)?. You also must set $USR-PRMT-TYPE-1=value where the type value is 1,2, 3 for real number value, integer (whole number) value or text input. If you have type 1 or 2 the input will be checked that it is a valid number e.g. '1.23' is a valid real number but '1qz4' is not. After checking what you enter is saved exactly as entered and will be output in the NC data wherever you have the variable @@USR-PRMT-VAL-1@@. This feature could be used for many different type on control input.

$PW-PIN-PLUNGE-XLIM2: These can be used for pin ring winding on pipes, this is a experimental feature, not fully documented at this time.

$PAY-TYPE: A user would not set this value, it is an integer ID automatically output into pay files which shows which part of the Cadfil system (e.g Vessel with end caps, MBD , Pipe....) created that pay file. It can be output into the NC winding program using the @@PAY-TYPE@@ token.

$NO-SUBS: A user would not set this value, it is a place holder for the number of items (subprograms) within a combined winding and its value will be set automatically when post-processing. The value can be output into the NC winding program using the @@NO-SUBS@@ token. A might be if you wanted 1 of 5 , 2 of 5 type messages in the NC data, this token would supply the 5.

$PROCESS-REPEAT-PAYFILES This takes the values 0 or 1 the default being 0. Sometimes in a combined winding the same payout file is used more than one time. If the NC machine uses a subprogram structure the pay file in question only needs to be processed once as each time it is used a call to the existing subprogram can be made. If the program has a block structure with goto loops (for example) then the pay file would need to be processed each time it is used because otherwise the program flow would not work correctly.

Next Section

Updated: 20 October 2020