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:

Post edit question


Recommended Posts

I am using the X4 mpmaster post on a Fadal 4020 VMC. I want to use a misc integer to add some codes to my drilling cycle when when needed. The codes I need are M46 before the drill cycle and M47 after the drill cycle. Here is a sample of how I want the code to look:

 

N1 G00 G17 G20 G40 G80 G90

N2 G91 G28 Z0.

N3 (DRILL .177 THRU 3 PLACES)

N4 T3 M06 (4.5MM YG DREAM DRILL)

N5 (MAX - Z1.)

N6 (MIN - Z-.0822)

N7 G00 G17 G90 G54 X-2.12 Y-.3554 S2000 M03

N8 G43 H3 Z1.

N9 Z.1

N10 G94

M46 ------- NEED TO ADD THIS HERE

N11 G99 G81 Z-.0822 R.1 F4.

N12 X0. Y-.62

N13 X2.12 Y-.3554

N14 G80

M47 ------- NEED TO ADD THIS HERE

N15 Z1.

N16 M05

N17 G91 G28 Z0.

N18 G28 Y0.

N19 G90

N20 M30

 

I want to be able to turn these codes on or off using a misc integer. Is this possible and is this a good way to go about accomplishing what a want. If so can someone point me in the right direction with some post editing help.

Link to comment
Share on other sites

Justin I would treat it as a string and then use the turning of it on to then turn it off when done. Create a sav_miX$ of what ever mi number you want to use. Then when it is called it will output the M46 and then in your close using the M47 it would use the sav_mi to close it.

 

Another way to write is to can text verse mi.

 

Simple way is to use if mi4$ = 1, "M46", e$ where you want it to start and if mi4$ = 1, "M47", e$ where you want it to end.

 

Someone should chime in if you are not sure how, if not I will help you tonight when I get home.

 

HTH

Link to comment
Share on other sites

Doug,

 

I got it to work but I had to change a few things. When I put the line if mi3$ = 1,"M46", e$ in the pdrlcommonb post block it was outputing the M46 on three different lines. I ended up putting it in here:

 

pdrill$ #Canned Drill Cycle

pdrlcommonb

if mi3$ = 1, pbld, "M46", e$ #USE MI3 TO TURN ON M46 CODE JB

pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,

prdrlout, [if dwell$, *dwell$], *feed, strcantext, e$

pcom_movea

 

Then I did the same thing for the other fixed cycles I wanted to activate it in.

 

I turned it off in this section of the the post:

 

pcanceldc$ #Cancel canned drill cycle

result = newfs (three, zinc)

if drillref = 0, zabs = initht_a #Make the initht the modal Z value

else, zabs = refht_a

prv_zia = zabs

!zabs

ps_inc_calc

prv_gcode$ = zero

if cool_zmove = yes$ & (nextop$=1003 | (nextop$=1011 & t$<>abs(nexttool))), coolant$ = zero

pcan

if mi3$ = 1, pbld,"M47", e$

if drillcyc$ <> 8, pcan1, pbld, n$, "G80", scoolant, strcantext, e$

pbld, n$, sgfeed, e$

pcan2

 

I also had to first activate mi3.

 

The only thing is now I can't get it to post an N number on the M46 and M47 lines.

 

 

Thanks for all the help

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