You could spend a few bucks and get this www.ncplot.com![]()
Hi
I need to edit the standrad MPFAN postprocessor for MC 9 to invert the values of X and Y
For example: postprocessor outputs X125.0 and I wan't to have X-125.0
I think I need this for I and J also.
Is this doable??
I'm having a Fanuc 21i system.
/Fredrik
You could spend a few bucks and get this www.ncplot.com![]()
Toby D.
"Imagination and Memory are but one thing, but for divers considerations have divers names"
Schwarzwald
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
www.refractotech.com
Toby D.
"Imagination and Memory are but one thing, but for divers considerations have divers names"
Schwarzwald
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
www.refractotech.com
The reason is that the coordinates is reversed in my machine compared to MC.
In MC all values to the right an top of the origin is positive, but in my machine those values are negative...
Or can I work around this with some G-code in my system.
Anyway, I wrote a small C# program to invert the values, but it would be great if I didn't have to do that.
/Fredrik
Is there a parameter in the control you could switch to have the axis inverted ?
Just thinking out loud here...
This can be done you just need to determine if changing it in the post is the best way for you to do it or not. If you do not have a large number of programs already for your machine tool you might be better off changing them in the machine to match the standard right hand rule. If you want to do it in the post processor you can though. I have done it several times and it seems to work great.
I am not going to tell you exactly how because I do not know your post, but to reverse the sign of a variable you use the logic below.
xabs is my variable for this example.
xabs = xabs * -1
This will take the value of xabs and change it from positive to negative or from negitive to positive. This is the easy part. The hard part is making sure you have this in the right location of your post. Where you need to put it will vary based on if your post supports rotary logic or not. Typically this is done where the XYZ and IJK matrix is mapped to the current plane.
I strongly sudgest you take this information to your Mastercam dealer and request this change. They should be able to make this change for you.
Thanks and I hope this helps
PS You have a PM
AC
Change the GCode filename extension to .TXT and open the file using Word for Windows as a text document.
Click the Edit Tab and then Replace.
Stick X in the replace bit and X- in the Replace With bit.
Do the same with Y.
Watch out for any X0 and Y0 values.. you'll need to change these manual cos the Replace will change these to X-0 which might mess up your program.
Save the file then rename it with the appropriate filename extension.
Hope this helps!
I love deadlines- I like the whooshing sound they make as they fly by.
theres a variable for changing that. If you search in the post (dia_mult) you'll find .....
dia_mult : 2 #Multiplier for output on X axis (Neg. switches sign of X)
y_mult : 1 #Multiplier for output on Y axis (Neg. switches sign of Y)
z_mult : 1 #Multiplier for output on Z axis (Neg. switches sign of Z)
dia_mult is what changes the output for Radius ot Dia.
Every X value runs thru it before getting output. Changing it to -2 will invert the value and make the output 2 times the radius.
Mike Mattera
Tips For Manufacturing Training CD's, DVD's for Mastercam, SolidWorks, Inventor, G-Code Training & More
http://www.tipsforcadcam.com
The default MPFAN in V9 contained some limited logic for this. To do it properly, open the .pst file and find the following section:
The xflip and yflip and zflip variables are the ones you are really interested in. The logic needs to be modified to work properly. Change it to:Code:pxyzcout #Map coordinates if rot_on_x, [ if cuttype = zero, pxyzcout0 #Toolplane Positioning if cuttype = one, pxyzcout1 #Axis Substitution if cuttype = two, pxyzcout2 #Polar Conversion if cuttype = three, pxyzcout3 #Simulatneous 4 axis (Multi-axis) if rot_ccw_pos = one, csav = -csav if mr_rt_actv <> two, [ pcoutrev if index, pindxcalc pfcalc ] else, feed = fr_pos ] else, [ xabs = vequ (x) feed = fr_pos ] #Check flags and change orientation # - eap 1/17/03 if xflip = yes, xabs = xabs * -1 # - eap 1/17/03 if yflip = yes, yabs = yabs * -1 # - eap 1/17/03 if zflip = yes, zabs = zabs * -1 # - eap 1/17/03
Now find the variable initializations in the post:Code:#Check flags and change orientation # - eap 1/17/03 if xflip = yes, [ xabs = xabs * -1 i = i * -1 ] if yflip = yes, [ yabs = yabs * -1 j = j * -1 ] if zflip = yes, [ zabs = zabs * -1 k = k * -1 ]
and change them to:Code:xflip : no #Reverse X axis orientation - eap 1/17/03 yflip : no #Reverse Y axis orientation - eap 1/17/03 zflip : no #Reverse Z axis orientation - eap 1/17/03
Code:xflip : yes #Reverse X axis orientation - eap 1/17/03 yflip : yes #Reverse Y axis orientation - eap 1/17/03 zflip : no #Reverse Z axis orientation - eap 1/17/03
Why did I think he was asking abouy a lathe post ?![]()
Mike Mattera
Tips For Manufacturing Training CD's, DVD's for Mastercam, SolidWorks, Inventor, G-Code Training & More
http://www.tipsforcadcam.com
Good Point Post_Guy. The I J K arc values also have to be flipped for the circles to come out right. It seems that code was missing from the original MPFAN.
![]()
Mike Mattera
Tips For Manufacturing Training CD's, DVD's for Mastercam, SolidWorks, Inventor, G-Code Training & More
http://www.tipsforcadcam.com