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:

about a post


tryon
 Share

Recommended Posts

good idea millman! sorry about that. Im just modifying the MPmaster

 

I got the idea that doing something like this was even possible from this topic. (Variables as tool numbers)from last week or so.

 

pdrill #Canned Drill Cycle

 

pdrlcommonb

pbld, 35, "1=", pzout, e

pcan1, pbld, n, *sgdrlref, *sgdrill, pfxout, pfyout, "Z", 35, "1", pcout,

prdrlout, dwell, *feed, strcantext, e

pcom_movea

 

this will post out like this

 

#1=Z-1.0

G98G81X0Y0Z#1R.1F15.

etc

 

I need to strip the Z out of the variable statement.

Link to comment
Share on other sites

just in the drill cycles i need the Z and F surpressed.

 

Its for our yasnaks,mazaks,brothers, and fanucs we use this format on all of our machines. Mainly because we use the same sub programs for our locations. ie. spot,drill,tap. If i can get our post to do this then ill just delete all the duplicate subs that you get when you use the subprogram option for drilling. Can mastercam know if it has just created more than one of the same subprograms and then get rid of the extra?

 

[ 12-01-2003, 05:51 PM: Message edited by: try-on ]

Link to comment
Share on other sites

Look for the drill cycles in your post, like this one..

 

code:

pdrill          #Canned Drill Cycle

pdrlcommonb

pcan1, pbld, n, *sgdrlref, *sgdrill, pfxout, pfyout, pfzout, pcout,

prdrlout, dwell, *feed, strcantext, e

pcom_movea

and remove the

 

code:

pfzout

and the

code:

*feed

calls and you should be all set.

 

Back up your post before you make any changes. wink.gif

 

'Rekd

Link to comment
Share on other sites

+1 on Rekd you could get fancy and use a mi control if you wanted but that is whole lot of work.

 

You can also use the tranform with sub and depending on how your post is set up it will do just movess or put all the code in the sub for you.

 

Crazy Millman

 

Teh update on the baby still waiting and waiting my wife has had contractions for 10 days now. They will see her tommorrow but affriad they wait till the 20th to induce labor. My wife at this point if very uncomfortable but hanging in there strong. I appericate all you guys concern and will keep you posted. Looking like the biggest kid I have even seen born coming if she goes to the 20th looking like might be a 11 lb baby if so my wife will have to have a C-section not cool but could hurt her real bad the other way. Know proud dad is getting to worried dad. My wife could fit in my 34" shorts and wore then with the frist she had about 4" gap in my 36" in jeans sunday and it is all baby look at here from bach can't even tell she is pregant.

 

[ 12-01-2003, 08:24 PM: Message edited by: Millman^Crazy ]

Link to comment
Share on other sites

So far ive had no luck.. here are my fmt's and my pdrill block. Right now no_z is coming out as 0 and no_f is 1.

 

 

fmt "" 4 no_z #variable z output

fmt "" 4 no_f #variable f output

 

 

pdrill #Canned Drill Cycle

 

pdrlcommonb

no_z = z

no_f = feed

pbld, 35, "1=", *no_z, e

pbld, 35, "2=", *no_f, e

pcan1, pbld, n, *sgdrlref, *sgdrill, pfxout, pfyout, prdrlout, "Z", 35, "1", pcout,

"F", 35, "2", dwell, strcantext, e

pcom_movea

 

this is how this is working now.

 

T1M6

G0G90G54X0.Y0.S2139M3

G43H1Z.1T2

#1=0(should be what pzout would be with no "Z")

#2=1(should be what *feed would with no "F")

G99G81X0.Y0.R.1Z#1F#2

M98P6556Q9901

G80

Link to comment
Share on other sites

Take out the no_z and no_f assignments in the PDRILL postblock and add this code to the end of the PDRLCOMMONB postblock ->

 

code:

#Added to the end of the 'pdrlcommonb' postblock

if absinc = zero,

[

no_z = zabs

!zabs, !zinc

]

else,

[

no_z = zinc

!zinc, !zabs

]

 

no_f = feed

Produces output like this ->

 

code:

N20G43H1.25M8

#1=-.144

#2=19.1

N25G98G81X0.Y.497R-.034Z#1F#2

N30G80

Link to comment
Share on other sites

still no luck yet. im using V8

 

code is coming out

 

G43H1Z.1T2

#1=0

#2=1

G98G81X0.Y0.R.1Z#1F#2

M98P6556Q9901

G80

 

my blocks:

 

code:

 pdrlcommonb     #Canned Drill Cycle common call, before

if sav_dgcode = 81,

[

result = newfs (two, zinc)

if drillcyc = three, drlgsel = fsg1(-ss) + drillcyc * two

else, drlgsel = fsg2(dwell) + drillcyc * two

if initht <> refht, drillref = zero

else, drillref = one

prv_refht_a = c9k

prv_refht_i = c9k

prv_dwell = zero

]

if cuttype = three, sav_dgcode = gcode

else, z = depth

if cuttype = one, prv_zia = initht + (rotdia/two)

else, prv_zia = initht

pcom_moveb

comment

pcan

#5 axis must map the true Z, correct Z calculation here

if cuttype = three,

[

prv_zia = zabs + (-depth) + initht

zia = fmtrnd(zabs)

zinc = zia - prv_zia

]

 

if absinc = zero,

[

no_z = zabs

!zabs, !zinc

]

else,

[

no_z = zinc

!zinc, !zabs

]

no_f = feed

 

 

pdrill #Canned Drill Cycle

 

pdrlcommonb

pbld, 35, "1=", *no_z, e

pbld, 35, "2=", *no_f, e

pcan1, pbld, n, *sgdrlref, *sgdrill, pfxout, pfyout, prdrlout, "Z", 35, "1", pcout,

"F", 35, "2", dwell, strcantext, e

pcom_movea

 


Link to comment
Share on other sites

I apologize for the quick (not well thought out answer)

 

 

quote:

code is coming out


code:

 G43H1Z.1T2

#1=0

#2=1

G98G81X0.Y0.R.1Z#1F#2

I noticed in your earlier posting that you had ->

code:

  fmt "" 4 no_z #variable z output

fmt "" 4 no_f #variable f output

This is what I see in the MPFAN.PST for the definition of Format Statement (FS) #4 ->>

code:

fs2 4   1 0 1 0     #Integer, not leading

Using this format you are only going to see INTEGER outputs (NO sign or decimal point or trailing zeros)

 

My guess is that you are you are using the wrong FMT assignment.

 

You are attempting to take the value from either ZABS or ZINC, put it into NO_Z and output as NO_Z

So... What is the FMT number assigned to ZABS and ZINC in your PST ?

If your post is derived from the std. MPFAN.PST, '4' is not correct.

 

Formats defined in the MPFAN.PST {Edited for brevity}

code:

fmt  Z  2   zabs        #Z position output

fmt Z 3 zinc #Z position output

fmt F 15 feed #Feedrate

There are a couple of ways to handle this situation (like most everything in a PST!)

 

-------------

Solution #1 ->

 

Since ZABS and ZINC are using different formats, we'll create two different 'no_z' variables and use the proper matching format.

code:

fmt ""  2  no_zabs

fmt "" 3 no_zinc

fmt "" 15 no_f

(Note that the "" are not really necessary here, but it's OK to have them)

 

 

----------------------------

Now down in the area of the PDRLCOMMONB & PDRILL postblocks...

 

NOTE..

# NO code added to the PDRLCOMMONB postblock...

 

Since we are removing the call to PFZOUT in the PDRILL postblock, I'm just replicating the basic code from PFZOUT with the new special output code.

 

code:

pdrill #Canned Drill Cycle

 

pdrlcommonb

if absinc = zero,

[

no_zabs = zabs

pbld, 35, "1=", *no_zabs, e

!zabs, !zinc

]

else,

[

no_zinc = zinc

pbld, 35, "1=", *no_zinc, e

!zinc, !zabs

]

no_f = feed

pbld, 35, "2=", *no_f, e

 

pcan1, pbld, n, *sgdrlref, *sgdrill, pfxout, pfyout, prdrlout, "Z", 35, "1", pcout,

"F", 35, "2", dwell, strcantext, e

pcom_movea

!feed

-------------

Solution #2 ->

 

You can alter the "prefix" that was assigned to the variable in the FMT statement using the NWADRS (New Address) formula.

 

Instead of defining 'no_zabs', 'no_zinc' you would temporarily change the FMT "prefix" on 'zabs' and 'zinc' as needed from 'Z' to nothing, and then change it back to 'Z' after.

 

First off you need to define a string variable that contains just "Z" and one that contains just an "F".

Search for this section in the MPFAN.PST ->

 

code:

#Address string definitions

strm "M"

strn "N"

stro "O"

strp "P"

srad "R"

srminus "R-"

sblank

And add the two new definitions ->

code:

#Address string definitions

strm "M"

strn "N"

stro "O"

strp "P"

srad "R"

srminus "R-"

sblank

strz "Z" # ADDED

strf "F" # ADDED

Now down in the area of the PDRLCOMMONB & PDRILL postblocks...

 

NOTE...

# NO code added to the PDRLCOMMONB postblock...

 

code:

pdrill #Canned Drill Cycle

 

pdrlcommonb

if absinc = zero,

[

result = nwadrs(sblank, zabs) # Re-define the "prefix" on zabs to "nothing"

pbld, 35, "1=", *zabs, e

result = nwadrs(strz, zabs) # Add the "Z" back on

!zabs, !zinc

]

else,

[

result = nwadrs(sblank, zinc) # Re-define the "prefix" on zinc to "nothing"

pbld, 35, "1=", *zinc, e

result = nwadrs(strz, zinc) # Add the "Z" back on

!zinc, !zabs

]

result = nwadrs(sblank, feed) # Re-define the "prefix" on feed to "nothing"

pbld, 35, "2=", *feed, e

result = nwadrs(strf, feed) # Add the "F" back on

 

pcan1, pbld, n, *sgdrlref, *sgdrill, pfxout, pfyout, prdrlout, "Z", 35, "1", pcout,

"F", 35, "2", dwell, strcantext, e

pcom_movea

Produces NC code like ->

code:

N104T2M6

N106G0G90G54X-1.4415Y1.7508A0.S750M3

N108G43H2Z.1

#1=-.375

#2=4.5

N110G99G81X-1.4415Y1.7508R.1Z#1F#2

N112X0.Y0.

N114X1.086Y-1.481

N116G80

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