Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

postprocessor help 1

Status
Not open for further replies.

moog2

Mechanical
Jan 16, 2007
441

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?
 
Replies continue below

Recommended for you

Yes it is possible.

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
 
 http://files.engineering.com/getfile.aspx?folder=f0bb4ff6-e950-4c0a-ad73-4e7536910c30&file=test.zip
thanks for your help John, i'll try that out on monday, when i can access postbuilder
 
Hi!
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
&#225; - &aacute;
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 "*&aacute;*" $MJ] == 1 } {
regsub "&aacute" $MJ "a" MJ
}

#..etc.

while { [string match "*&eacute;*" $MJ] == 1 } {
regsub "&eacute;" $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
 
My initial thought is that the proc is not being called for each operation. Where are you calling the cstom command? You may need to place it in several location in your post for each event to recognize it.

John Joyce
Tata Technologies iKS
1675 Larimer St.
Denver, CO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor