Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Adjusting MPLmasterpost to output M05 SP direction change and add G59 in place of G28


honeybunches
 Share

Recommended Posts

I am trying to make two last edits in the MPLpost. One is I need to input an M05 when the spindle switches direction. There is some language for it in the post but I expected there to be a switch for it since that is common.

 

Also wanting to apply an offset for tool changes instead of returning the machine to home position. Certainly open to other ideas to easily change TC position. Would prefer to take turret all the way home at M30 so I thought if I added an offset for TC, the end program would still be the same.

 

Just curious if anyone has run into this. Another generic post.

Link to comment
Share on other sites

X2MR2

 

Machine is a Mori with 0T-C. Machine should not matter so much. Code is just wrong.

 

G50 S5000

G96 S1000

G1 G41 X-.0625 F.005

G0 Z.1

G1 G40 Z.2

M9

G97 S5000

G28 U0. W0.

(TOOL - 9 OFFSET - 9)

(SPOT TOOL .75 DIA.)

(CENTER DRILL)

G54

N9 T0909

G99

G97 S2000 M03

G0 X0. Z.2

 

Here is a sample of what is spit out. I have been putting the M05 before the G54 but that is not in concrete.

Link to comment
Share on other sites

Has your post been modified or do you have the latest MPLMASTER from the website?

It would appear your post is missing information. You also do not have "Tx00" at the end. You may not need it, but I always have mine post it.

I would try another post, if your machine can use it. If not, download the latest master for your version and compare those parts in the post to see what's missing.

Link to comment
Share on other sites

fstrsel sg28 ref_ret sg28ref 2 -1

 

 

This is all that is found for g28. g28 uvw0 returns nothing.

 

#Retract to reference return

pbld, n$, `sgcode, psccomp, e$

if home_type = m_one & drop_offset, pbld, n$, *toolno, e$

if frc_cinit, pbld, n$, pclampoff, e$

pcan1, pbld, n$, *sg28ref, "U0.", [if y_axis_mch, "V0."], "W0.", protretinc, pnullstop, strcantext, e$

if home_type > m_one & drop_offset, pbld, n$, *toolno, e$

 

This was found in the post as well. I suspect I will need to rewrite the sg28 line and possibly every line in the post that uses it?

Link to comment
Share on other sites

pcan1, pbld, n$, pnullstop, *sg28ref, "U0.", [if y_axis_mch, "V0."], "W0.", strcantext, e$

 

This is how mine posts the M5 now. It did not, at first, but I added the "pnullstop" in the location you see above. Now the M5 shows up on the same line as the G28 U0. W0.

 

Yours has it from what you posted above, but is not outputting it. Try adding * to it "*pnullstop" to force its output. See if that works.

Link to comment
Share on other sites

regarding the M05 problem,

 

#Switch G97/G96 or direction at null or dwell

#Stop the spindle if direction changes

if (prv_g_spdir <> g_spdir) & abs(prv_g_spdir - g_spdir) <> three,

pbld, n$, *pnullstop, e$ #added * bm

if css_actv$,

[

speed = g_speed

pnullg50

if prv_speed <> speed | prv_g_spdir<>g_spdir | prv_css_actv$<>css_actv$, pcss #(09/05/01)

]

else,

 

 

This is the post code I believe to be driving the M05 output. I am not sure yet if there is a switch I am missing or what. I added the * but still will not force the M05 output

 

 

Regarding the G28 ref return, I added a line to include sg59ref_ret G59 and it will output the G59 in place of the G28 but my goal is the use an offset for TC only and allow it to return G28 at M30. So far, I get all one or the other even when setting my ref_ret coding different for TC and program end.

 

Gunna have to look at this some more I guess..

Link to comment
Share on other sites

It's a struggle for me, as well. I don't have the computer programming background that I think I should have to fully understand the way a post works. I usually end up trying different things here and there to see what happens.

Then, it's kind of a guess as to what changes you should make. I can usually get what I want, but I'm not exactly sure why it happens sometimes.

Good luck. I'll try to help if I can. I know that you should probably check the post for very similar parts. Sometimes you only change one and it works sometimes, but there's another section lurking in there that needs the same update.

Link to comment
Share on other sites

quote:

Try adding * to it "*pnullstop" to force its output. See if that works.

FYI Guys - * cannot be used to foce output from a postblock.

 

* is used to force output of a variable

 

Viper - Look for the variable you want to force within the pnullstop postblock and add the * in front of that variable. Remove the * from the pnullstop calls, this is improper use of the * modifier.

 

Can you post the pnullstop postblock?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...