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:

Maximum Zand Minimum Z in Post isn't working.


Daniel M
 Share

Recommended Posts

Something wierd going on here...

 

My post is kicking out bogus numbers for the max and min Z in the header section. Heres whats in the .pst :

 

psof$ #Start of file for non-zero tool number

starline, e$

"(MAXIMUM Z", *z_max$, ")", e$

"(MINIMUM Z", *z_min$, ")", e$

 

 

Any ideas?

 

Thanks!

 

Daniel

Link to comment
Share on other sites

He probably never completed setting it up.

 

That post as it comes "out of the box" is not set up to do that, so it's something either he or someone was modifying for him.

 

You might take a peek at the MPMaster to see how it is accomplished in that post if you'd like to get it working. Otherwise you can probably place # in front of the lines and leave it for the time being./

Link to comment
Share on other sites

The z_max$ and z_min$ variables are reset at each toolchange, so the output you are getting are the min. and max. values for the last tool, not for the entire program.

 

You need to collect the values in pwrtt$ (and psof$ for the values for the last tool) in order to get the min. and max. values for the entire program.

 

I don't think we (CIMCO Integration) have a post where the min. and max. Z values for the entire program are determined, but it would be very simple to do that. We do have post processors where the min. and max. Z values for each tool are output in the tool table at the top of the program, as those values tell the operator how long a tool the operator should set up.

Link to comment
Share on other sites

Christian,

 

I wish I found this to be very simple as you do. I looked at those sections of my post and I didn't see any 'simple' solution....was hoping for something like "to get max and min Z for entire program change this setting to 2".

 

Any chance you'd give me some more clues?

 

Thanks, D

Link to comment
Share on other sites

you'll need this on your psof section

 

code:

if output_z = yes$ & tcnt > 1,

[

"(OVERALL MAX - ", *z_tmax, ")", e$

"(OVERALL MIN - ", *z_tmin, ")", e$

]

you'll need to place this in your General Output settings

 

code:

output_z    : yes$   #Output Z Min and Z Max values (yes or no)

you'll need to format these variables

 

code:

z_min$      : 99999 # Min Z

z_tmin : 99999 # Overall min Z

z_max$ : -99999# Max Z

z_tmax : -99999# Overall max Z

tapflg : 0 # Flag for tap cycle

sav_mi9 : 0 # Saved mi9 value

you'll need to create this post block

 

code:

ptravel    # Tool travel limit calculation

if x_min$ < x_tmin, x_tmin = x_min$

if x_max$ > x_tmax, x_tmax = x_max$

if y_min$ < y_tmin, y_tmin = y_min$

if y_max$ > y_tmax, y_tmax = y_max$

if z_min$ < z_tmin, z_tmin = z_min$

if z_max$ > z_tmax, z_tmax = z_max$

you'll need to create this buffer

 

code:

# --------------------------------------------------------------------------

# Buffer 5 Read / Write Routines

# --------------------------------------------------------------------------

pwritbuf5 # Write Buffer 1

b5_gcode = gcode$

b5_zmin = z_min$

b5_zmax = z_max$

b5_gcode = wbuf(5, wc5)

 

preadbuf5 # Read Buffer 1

size5 = rbuf(5,0)

b5_gcode = 1000

min_depth = 99999

max_depth = -99999

while rc5 <= size5 & b5_gcode = 1000,

[

if rc5 <= size5, b5_gcode = rbuf(5,rc5)

if b5_zmin < min_depth, min_depth = b5_zmin

if b5_zmax > max_depth, max_depth = b5_zmax

]

you'll need to define the same buffer

 

code:

# --------------------------------------------------------------------------

# Buffer 5 - Min / Max

# --------------------------------------------------------------------------

b5_gcode : 0

b5_zmin : 0

b5_zmax : 0

rc5 : 2

wc5 : 1

size5 : 0

 

fbuf 5 0 3 0 0 #Min / Max

Then you can add this at the top of the psof section

 

code:

psof$            #Start of file for non-zero tool number

ptravel

pwritbuf5

Then add these into the pwrtt section

 

code:

 ptravel

pwritbuf5

Now are you sure you wouldn't rather look through the MPMaster or if this is ALL above your head contact your reseller.

Link to comment
Share on other sites

John,

 

That was an awesome reply. Best overall lesson I've ever had for insight on what needs to be done in a post to accomplish a needed result. I looked in the MPMASTER and didn't see anything that.....oh wait, just found it.

 

Still, many thnks for your reply. I'll use it.

 

D

Link to comment
Share on other sites

It can be done a lot simpler than JParis describes.

 

1. Format and initialize the variables for program Z min. and max:

code:

fmt Z 1 z_min_p

fmt Z 1 z_max_p

z_min_p : 9999

z_max_p : -9999

2. Insert this code in the pwrtt$ postblock:

code:

pwrtt$

if z_min$ < z_min_p, z_min_p = z_min$

if z_max$ > z_max_p, z_max_p = z_max$

3. Insert the same two lines in the psof$ postblock and output the result:

code:

psof$

if z_min$ < z_min_p, z_min_p = z_min$

if z_max$ > z_max_p, z_max_p = z_max$

"(", MAX. Z VALUE:", *z_max_p, ")", e$

"(", MIN. Z VALUE:", *z_min_p, ")", e$

That is all that is needed to output the min. and max. values for the entire program.

Link to comment
Share on other sites

I asked a while ago on here, and got no response, about outputting the Min/Max values for each tool in the tooltable in the header of the program, rather than at each tool change.

 

This would be better for me, as it would tell the operator what lengths the tools need to be.

 

Is there an easy way to accomplish this? I did try it, but the results were out of sync, and some outputs had 0 or -9999.999.

Link to comment
Share on other sites

Dan,

 

Give me a call. Let's get together on a Saturday and I'll give you a lesson on how the post works and the documentation you will need to understand it. You will probably want to do some live 4th axis programming on your fadal at some point, and I can show you how that works...

 

Hope everything is well. Talk to you soon.

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