<< Click to Display Table of Contents >> Navigation: MILL Module > Post Processing Machining Operations > Use Programmable Post > Post Events |
Programmable Post Processor has event driven architecture. Before outputting a specific block of G-code event is called. List of available events can be found at "Post event list" section.
User can specify output g-code block format on each event and Set/Get Global Post variables using objects from event parameters:
def OnEndProcessing(blockData: PostBlockData, globalData: PostGlobalData): return |
PostBlockData object used to get or set G-Code block format for called event. Some block formats can contain multiple lines. For these cases each line should be separated by '\n' symbol (user can use .splitlines() and .join functions from python to process them).
PostBlockData |
|
Methods |
Description |
Set(string) |
Set block format string |
Get() |
Get block format string |
Example of modification block output format:
def OnRapidMotion(blockData: PostBlockData, globalData: PostGlobalData): data = blockData.Get() data = data + " - Modified by OnRapidMotion" blockData.Set(data) return |
To access global(system) post variables user can use PostGlobalData object, list of variables can be found at "Post variable list" section
PostGlobalData Object Methods |
|
Methods |
Description |
GetIntVar(string) |
Get variable value as Int |
GetFloatVar(string) |
Get variable value as float |
GetStrVar(string) |
Get variable value as string |
SetIntVar(string, value) |
Set int value for variable |
SetFloatVar(string, value) |
Set float value for variable |
SetStrVar(string, value) |
Set string value for variable |
Example of modification of variable from variable list:
def OnRapidMotion(blockData: PostBlockData, globalData: PostGlobalData): nextX = float(globalData.GetStrVar("[NEXT_NONMDL_X]")) # e.g. converting to float by using Python nextX = nextX + 1.3 globalData.SetFloatVar("[NEXT_NONMDL_X]", nextX) return |