Migrating Post-Processor POST_BASE

Prior to V11.0, we had the POST_BASE global variable as a way alleviating some of the repetitions inherent to post-processors to make their management and organisation easier. This seemed to create trouble over the years, so we have stopped supporting it.

This guide will help migrate from some of the old post-processors.

Default Post-Processors

If you have not made any changes to your post-processor, you could find it again in the Vectric shipped database in the Post-Processor Management dialog and simply click 'Customise' to add it again to your My_PostP folder.

For the purpose of this guide, we will demonstrate this on the Next Wave post-processor, but the guidelines here can be applied to any post-processors.

The base does not need to change

In this guide, we will go through how to replace the POST_BASE statement. We will never have to alter the base post-processor (referenced in that statement), but only the post-processor containing that statement. Please always back up your file first.

Check your output

Save some toolpaths using this new post and check the output!

What is a Base Post

In previous versions of the software then it was possible for a post-processor to have a base post-processor. The base post-processor had common sections in it. Then any other post-processor could take this post-processor as it's starting point, overwriting the bits it needed to. In this case we would say that this new post-processor inherited the base post-processor.

Summary of Migration

Assuming a post-processor Next_Wave_CNC_mm.pp which inherits the Next_Wave_CNC.pp post-processors:

The syntax of a typical POST_BASE statement is POST_BASE = "Next_Wave_CNC.pp"

Since this is no longer supported, we would need to replace this statement with the contents of Next_Wave_CNC.pp, removing any duplication from the copied content.

Step-by-Step Example

Again, assuming the Next Wave post-processors

Next_Wave_CNC.pp

We have Next_Wave_CNC.pp (inch post-processor) with the content containing the following,


POST_NAME = "Next Wave CNC (inch)(*.tap)"
FILE_EXTENSION = "tap"
UNITS = "INCHES"
DIRECT_OUTPUT = ""
SUBSTITUTE = "({)}"
LASER_SUPPORT = "YES"
+------------------------------------------------
+ Line terminating characters
+------------------------------------------------
LINE_ENDING = "[13][10]"
+------------------------------------------------
+ Block numbering
+------------------------------------------------
LINE_NUMBER_START = 0
LINE_NUMBER_INCREMENT = 10
LINE_NUMBER_MAXIMUM = 999999
+================================================
+
+ Formating for variables
+
+================================================
VAR LINE_NUMBER = [N|A|N|1.0]
VAR POWER = [P|A| S|1.0|10]
VAR SPINDLE_SPEED = [S|A|S|1.0]
VAR CUT_RATE = [FC|A|F|1.1]
VAR PLUNGE_RATE = [FP|A|F|1.1]
VAR X_POSITION = [X|A| X|1.4]
VAR Y_POSITION = [Y|A| Y|1.4]
VAR Z_POSITION = [Z|A| Z|1.4]
VAR ARC_CENTRE_I_INC_POSITION = [I|A| I|1.4]
VAR ARC_CENTRE_J_INC_POSITION = [J|A| J|1.4]
VAR X_HOME_POSITION = [XH|A| X|1.4]
VAR Y_HOME_POSITION = [YH|A| Y|1.4]
VAR Z_HOME_POSITION = [ZH|A| Z|1.4]
VAR DWELL_TIME = [DWELL|A|P|1.2]
+================================================
+
+ Block definitions for toolpath output
+
+================================================
+---------------------------------------------------
+ Commands output at the start of the file
+---------------------------------------------------
begin HEADER
"( [TP_FILENAME] )"
"( File created: [DATE] - [TIME])"
"( for Next Wave Automation from Vectric )"
"( Material Size)"
"( X= [XLENGTH], Y= [YLENGTH], Z= [ZLENGTH])"
"( Z Origin for Material = [Z_ORIGIN])"
"( XY Origin for Material = [XY_ORIGIN])"
"( XY Origin Position = X:[X_ORIGIN_POS], Y:[Y_ORIGIN_POS])"
"( Home Position)"
"( X = [XH] Y = [YH] Z = [ZH])"
"( Safe Z = [SAFEZ])"
"([FILE_NOTES])"
"(Toolpaths used in this file:)"
"([TOOLPATHS_OUTPUT])"
"(Tool used in this file: )"
"([TOOLS_USED])"
"([TOOLNAME])"
"(|---------------------------------------)"
"(| Toolpath:- '[TOOLPATH_NAME]' )"
"(|---------------------------------------)"
"G90"
"G20"
"[FC]"

Next_Wave_CNC_mm.pp

We also have Next_Wave_CNC_mm.pp which inherits it as


POST_NAME = "Next Wave CNC (mm)(*.tap)"
POST_BASE = "Next_Wave_CNC.pp"
UNITS = "MM"
LASER_SUPPORT = "YES"
+================================================
+
+ Formating for variables
+
+================================================
VAR LINE_NUMBER = [N|A|N|1.0]
VAR POWER = [P|A| S|1.0|10]
VAR SPINDLE_SPEED = [S|A|S|1.0]
VAR CUT_RATE = [FC|A|F|1.1]
VAR PLUNGE_RATE = [FP|A|F|1.1]
VAR X_POSITION = [X|A| X|1.3]
VAR Y_POSITION = [Y|A| Y|1.3]
VAR Z_POSITION = [Z|A| Z|1.3]
VAR ARC_CENTRE_I_INC_POSITION = [I|A| I|1.3]
VAR ARC_CENTRE_J_INC_POSITION = [J|A| J|1.3]
VAR X_HOME_POSITION = [XH|A| X|1.3]
VAR Y_HOME_POSITION = [YH|A| Y|1.3]
VAR Z_HOME_POSITION = [ZH|A| Z|1.3]
VAR DWELL_TIME = [DWELL|A|P|1.2]
+================================================
+
+ Block definitions for toolpath output
+
+================================================
+---------------------------------------------------
+ Commands output at the start of the file
+---------------------------------------------------
begin HEADER
"( [TP_FILENAME] )"
"( File created: [DATE] - [TIME])"
"( for Next Wave Automation from Vectric )"
"( Material Size)"
"( X= [XLENGTH], Y= [YLENGTH], Z= [ZLENGTH])"
"( Z Origin for Material = [Z_ORIGIN])"
"( XY Origin for Material = [XY_ORIGIN])"
"( XY Origin Position = X:[X_ORIGIN_POS], Y:[Y_ORIGIN_POS])"
"( Home Position)"
"( X = [XH] Y = [YH] Z = [ZH])"
"( Safe Z = [SAFEZ])"
"([FILE_NOTES])"
"(Toolpaths used in this file:)"
"([TOOLPATHS_OUTPUT])"
"(Tool used in this file: )"
"([TOOLS_USED])"
"([TOOLNAME])"
"(|---------------------------------------)"
"(| Toolpath:- '[TOOLPATH_NAME]' )"
"(|---------------------------------------)"
"G90"
"G21"
"[FC]"

Changes Summary

We would like to change the contents of Next_Wave_CNC_mm.pp such that it does not have POST_BASE and does not depend on the content of Next_Wave_CNC.pp.

You will note that Next_Wave_CNC_mm.pp has changed the following,

  1. POST_NAME
  2. UNITS
  3. LASER_SUPPORT
  4. Various variables
  5. The HEADER section

We have to ensure that those things are kept the same in the new Next_Wave_CNC_mm.pp.

Steps

This will serve as a rough set of steps on how to approach this.

  1. Create a new empty file (called Next_Wave_CNC_mm_2.pp, for example) and copy the contents of the Next_Wave_CNC.pp into it.
  2. Go through the old inheriting post-processor (Next_Wave_CNC_mm.pp) and copy / replace the variables and sections.
  3. For example, replace POST_NAME, UNITS and LASER_SUPPORT

The beginnings of the new post-processor should look something like this

POST_NAME = "Next Wave CNC (mm)(*.tap)"
FILE_EXTENSION = "tap"
UNITS = "MM"
DIRECT_OUTPUT = ""
SUBSTITUTE = "({)}"
LASER_SUPPORT = "YES"

Keep going and replace / add the variables (starting with VAR).

Replace the begin HEADER section.

Check the result

Diff the contents of Next_Wave_CNC.pp and Next_Wave_CNC_mm_2.pp and you should see that the differences are essentially the contents of Next_Wave_CNC_mm.pp.

Remove Next_Wave_CNC_mm.pp and rename Next_Wave_CNC_mm_2.pp to Next_Wave_CNC_mm.pp.

Check your output

Save some toolpaths using this new post and check the output!