postprocessor help
postprocessor help
(OP)
i need to add a if-then type of feature into the end of a 5 axis post processor.
The tool needs to avoid large jobs by moving to the edge of the envelope, depending on whichever side is nearer to the last Y move in the program.
The Y axis has a stroke of 5metres, if the last Y move in the program is less than 2500mm then i want it to add a move of Y 100, and if the last Y move is above 2500mm i want it to add a move of Y 4900mm.
I don't know if it's possible, can anyone help?





RE: postprocessor help
You would need to first capture the Y motion this can be done at the end of path event using a custom command
global mom_pos
global last_y
set last_y $mom_pos(1)
Then at the End of Program you can test the last_y variable and output the motion you need.
global last_y
if {$last_y <2500} {MOM_output_literal "Y100."}
if {$last_y >2500} {MOM_output_literal "Y4900."}
See the attached post
John Joyce
Tata Technologies iKS
1675 Larimer St.
Denver, CO
www.myigetit.com
RE: postprocessor help
RE: postprocessor help
I have n other postprocessor problem:
My program groups have attributes, what i use as comments on the shopdoc. It works fine. I want to write these attribs to the program header, but there is a problem:
the NC controllers don't like special characters like
á - á
etc.
I wrote a code to replace these characters:
global mom_attr_PROGRAMVIEW_MEGJEGYZES
global mom_attr_PROGRAMVIEW_EGYEB
if {[hiset mom_attr_PROGRAMVIEW_MEGJEGYZES]}\
{ set MJ $mom_attr_PROGRAMVIEW_MEGJEGYZES
while { [string match "*á*" $MJ] == 1 } {
regsub "á" $MJ "a" MJ
}
#..etc.
while { [string match "*é*" $MJ] == 1 } {
regsub "é" $MJ "e" MJ
}
set MJ [string toupper $MJ]
MOM_output_literal "($MJ)"
}
This code works correctly in a simple Wish console(8.1), but when i try it in a post, only the first regsub has run, all the while cycle has been ignored..
so if i want to change any character from the attrib (ie. "g" to h"") to an other, only the 1st instance will change..
(from "gagagag" will be "hagagag", not hahahah)
what is the problem?
thanks in advance
----
kukelyk
RE: postprocessor help
John Joyce
Tata Technologies iKS
1675 Larimer St.
Denver, CO
www.myigetit.com