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:

how to post z min. as command on Gennetic Fanuc 2x Lathe


Recommended Posts

Greeting @AndrewNg

For the things you want to do there are few ways to do it.

First step can be done like this ( From MP reference guide)

Minimum Z axis value from NCI motion between tool changes.
This is part of a set of variables that capture the minimum and maximum NCI values from axis motion between tool changes.
The following discussion mentions z_min$ and z_max$ but please understand that everything applies equally well to x_min$, x_max$, y_min$ and y_max$.
Capture these variables in the pwrtt$ postblock to determine the minimum and maximum values for the entire NCI file.
It is important to understand that because the values of z_min$ and z_max$ can’t be known until the entire operation has been processed, while the operation is being processed those variables still have the values from the previous operation. So while pwrtt$ is being executed, some variables (like t$) always refer to the current tool being processed, but other variables like z_min$ and z_max$ effectively refer to the previous tool.
This means that if you want to output these values with the current tool number, you need to do the following:    
1. Ignore the first call to pwrtt$.    
2. Set toolchange$ = 3. This will add an extra final call to pwrtt$ so you can capture the min and max values for the last operation.    
3. Create a variable to store the number of the previous tool.
The following code shows how you might accomplish this:                
tooltable$      :  3    
 sav_t : 0      
pwrtt$             # Tool table output          
if t$ > 0,
   [            
   if gcode$ <> 1001, "[", *sav_t, *z_min$, *z_max$, "]", e$
   sav_t = t$
   ]          
While z_min$ and z_max$ store the min and max values for the current operation, you can easily modify the above code so that you can also get the min and max values for the entire part.
Create two new variables (z_min_all and z_max_all) and use them to keep track of the overall min and max values as each tool is processed.
After the tool table has been processed, you can output them at your convenience. In example below, the min and max values for each tool are output in the tool table, then the overall min and max values are output once in the psof$ postblock.


second way:

You can just assign z_max$ variable to a buffer
which means you should do buffer definition first
for example : 
fbuf 1 0 9 0 0

for more about it, please read this topic: 
@Colin Gilchrist



third option

You can get all those information's from your .set file

to do that you should use file manipulation variables in ppost$ postblock
Variables which you should use:
    # snamenc$  File name for the NC file output stream.
    # spathnc$  File path for the NC file output stream.
    # sextnc$   File name extension for the NC file output stream.
    # sextaux$  File name extension for the alternate file output stream auxprg$. The string is initialized to .AUX by default, but can be overridden.
    # auxprg$   Use this variable to open an alternate output file (.AUX). NC output will be directed to the AUX file when it has been opened with auxprg$ and the subout$ variable is set to 2.
    # newaux$   Open a file to receive output for the AUX stream (subout$ = 2). You can open a new file or open an existing file and append the new output to it; use the auxprg$ setting to control the output mode.
    # subout$   Determines which file output will be written to. Use this to create one or more alternate streams of NC data that you can write out to different files or merge together.

 

before getting the main output as NC file I recommend you to do all the tests in the aux file.
Why?
Because what you will do in ppost$ block is this:
you will run MP.dll to get output from .set file
once you have output of your .set file in aux format you will select which line you want to grab from there and add to the main NC output.

If you or anyone else there wants to know how can this be done feel free to PM and I will explain step by step what to do.


I hope things above can help you.


Kind regards

Ivan.

 

 

 

 

 

 

  • Thanks 2
  • Like 2
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...