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:

Creating/setting up misc integers?


Joe788
 Share

Recommended Posts

This is a topic that has been a little fuzzy for me for awhile. I've searched the archives, and didn't really find anything I could apply.

 

I want to edit my MPMaster post to input G61.1,K10 after the G43 approach. I don't need to cancel it, so that's not an issue.

 

I'd also like to set up another misc integer to insert a G05P2 after the G43 approach, and a G05P0 before the "G91G28Z0" at the end of the toolpath.

 

It seems like these two things should be relatively simple to implement compared to other tweaks I've had to make to the post, but I just can't seem to figure it out. bonk.gif

 

I'm using X3(*coughX4cough*), with an MPMaster post that I've been updating since V9.1.

 

Any idea where I should start?

Link to comment
Share on other sites

I just added a similar thing to my Mori post. i wanted a G332 before my G43 line. I found where my G43 line was coming from in the post and added some simple logic

 

if mi$3 = 1

"G332"

 

That is a very simple version of what i did. I had to add more for modes and turning it off and a misc real to set the mode. But that is the simple version of how i started. Then you will want to change you control file to label the misc #'s in your operations.

 

I am sure someone with much more experience can give you better overview. But that might get you started.

Link to comment
Share on other sites

Thanks for the info Jrygus. Do you remember exactly where you put that little logic call? I've found the G43 in two different spots in my post, but there's A LOT of stuff in front and behind it. I'm not sure where I should stick it, but what you have there would completely solve my first task (if I could figure out where to put it).

 

 

Here's the G43 that's in the pstop section:

 

code:

 pstop      # Stop routine

pretract

toolchng = one

pcom_moveb

if mi10$=one, n$, *sm00, e$

sav_absinc = absinc$

if wcstype > one, absinc$ = zero

comment$

pindex

if lock_codes = 1 & not(index) & rot_on_x, pbld, n$, *sunlock, "(UNLOCK)", e$

pcan1, pbld, n$, *sgcode, *sgabsinc, [if not(index), pwcs], pfxout, pfyout,

pfcout, *speed, *spindle, pgear, strcantext, e$

if lock_codes = 1 & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, "(LOCK)", e$

pbld, n$, "G43", *tlngno$, pfzout, scoolant, e$

sav_coolant = coolant$

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

absinc$ = sav_absinc

toolchng = zero

 

pmisccheck #Check if Misc Values are enabled

if miscerror & miscvalon = 0,

[

result = mprint(smiscerror,1)

spaces$ = 0

*e$

"(", smiscerror, ")", e$

spaces$ = sav_spc

exitpost$

]

 

 


And then here's the other one that's in the ptlchg_com section:

 

 

code:

 ptlchg_com      #Tool change common blocks

pcom_moveb

c_mmlt$ #Multiple tool subprogram call

#ptoolcomment

comment$

pmisccheck

pcan

if plane$ < 0, plane$ = 0

if stagetool >= zero, pbld, n$, *t$, "M06", ptoolcomm, e$

spaces$=0

n$, next_tool$, e$

if output_z = yes$,

[

preadbuf5

if (opcode$ > 0 & opcode$ < 16) | opcode$ = 19,

[

n$, pspc, "(", "MAX - ", *max_depth, ")", e$

n$, pspc, "(", "MIN - ", *min_depth, ")", e$

]

]

 

spaces$=sav_spc

pstock

pindex

sav_absinc = absinc$

if wcstype > one, absinc$ = zero

if lock_codes = 1 & not(index) & rot_on_x, pbld, n$, *sunlock, "(UNLOCK)", e$

pcan1, pbld, n$, *sgcode, *sgabsinc, [if not(index), pwcs], pfxout, pfyout,

pfcout, *speed, *spindle, pgear, strcantext, e$

if lock_codes = 1 & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, "(LOCK)", e$

pbld, n$, "G43", *tlngno$, pfzout, scoolant, e$

sav_coolant = coolant$

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

absinc$ = sav_absinc

pcom_movea

toolchng = zero

c_msng$ #Single tool subprogram call

last_op_id = op_id$

last_cuttype = cuttype

Link to comment
Share on other sites

Yeah i had 2 as well. One in the psof for the start of the file and one in the ptlchg_com for tool changes.

 

Here is what my post looks like now in the psof

 

 

if mi1$ = 1 & mr2$ = 0 # Added for G332 mode on Mori Sieki

pbld, n$, "G332", mr3$, e$

 

phsm1_on #must remain before G43 #(This line was already there)

pbld, n$, "G43", *tlngno$, pfzout, scoolant, next_tool$, e$

 

in the ptlchg_com i added it to the Ai nano

 

if mr1$ = 2, #AI-NANO 2, AI(nano)CC output (Artificial Intelligence Contour Control) - G05.1 Q1

[

pbld, n$, *sg49, e$ #Must be in G49 and remain before G43

if ipr_type > 1, ipr_type = 0 #Must be in G94

pbld, n$, sgfeed, e$

if mi1$ = 1 # Added for G332 mode on Mori Sieki

pbld, n$, "G332", mr3$, e$

 

pbld, n$, "G05.1", "Q1", [if mr2$, "R", no_spc$, *mr2$], e$ #Mr2 gives accel/decel value/coefficient, usually R or P

mr1_flg = 2

]

 

 

Where you see the "G332" is where i added it. Note that mine is before the G43

 

What i like to do to test for positioning of code output is just add the line

 

"TEST", e$

 

To my test post, then post and see if i get the text of TEST in my code. Then you know you are in the right spot. Then work on your logic.

Link to comment
Share on other sites

Edit:

 

OK that did the trick! I've got misc. integer set to insert G61.1,K10 on the line right after the G43.

 

Thanks for the help!

 

Now, anybody know how to go about the more complex task of insert G05P2, and then canceling it before the G91G28Z0.?

 

[ 04-21-2009, 05:41 PM: Message edited by: Joe788 ]

Link to comment
Share on other sites

Unfortunately, I'm using the old mpmaster that I've updated a bunch of times. It's got a lot of little tweaks and I hate to start all over, though I'll likely do it at some point. It's just nice to have something I can trust (and have trusted for many years).

 

I managed to get the G05P2 to come in on the line after the G61.1 using your same little formula:

 

code:

if mi3$ = 1

pbld, n$, "G05P2", e$

I also used the same formula in the pretract section, to call G05P0, but I can't for the life of me get it to call before the M09, even when I put the...

 

code:

if mi3$ = 1

pbld, n$, "G05P0", e$

....on the very first line of the pretract section.

 

I managed to struggle through the fist part of this with the tips that you provided, but I think I'm at sort of a dead end now. If I could just figure out how to get the thing BEFORE the coolant stop call, I'd be totally dialed in.

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...