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 Processor Error Checks for Home Values


Recommended Posts

Using Mastecam X5 mu1

 

Hope someone can show me what I am doing wrong...

 

We are using a modified mplmaster post for a lathe.

 

An error Check has been added that gets the x home and z home for each operation.

 

I can get the xh$ and zh$ value but the zh$ causes some undesired output into the G code file.

 

The code below gets the x home value for each operation with no problem.

     xhome = vequ(xh$)
     xhome = xhome * 2  
     xhome = -xhome    
     sxhome = no2str(xhome)

 

However when I try the following line to get the z value the undesired code appears.

 

     zhome  = vequ(zh$)

 

When I use # to make it a remark or get the xh$ value a second time the error goes away.

Undesired Code below............Desired Code below
O1832...........................O1832
N10G20..........................N10G20
N20G97..........................N20G97
N30G99..........................N30G99
N40M17..........................N40M17
N50G50X-30.1Z13.232.............N50G50X-30.1Z13.232
N60G00T0200.....................N60G00T0200
N70G00T0202.....................N70G00T0202
N80M42 ------------------- undesired output
N90G97S111M03 ------------ undesired output
N100G50S600.....................N80G50S600
N110G96M42S700..................N90G96M42S700
N120M03.........................N100M03
N130G00X-24.125Z1.05M08.........N110G00X-24.125Z1.05M08
N140G50S600 -------------- undesired output
N150G96M42S700 ----------- undesired output
N160M03 ------------------ undesired output
N170G01Z0.F.012.................N120G01Z0.F.012
N180X-24.6794...................N130X-24.6794
N190X-25.2794...................M140X-25.2794

Link to comment
Share on other sites

I would recommend calling your Reseller for help setting this up. I have no idea what you are trying to do with capturing the home positions, but the "undesired" code is coming from the Tool Change Post Block. MPLMaster uses a different Post Block structure from CNC Software's Generic Posts.

 

We do have a Generic Mori Seiki Post available for Lathe, that shouldn't require such extensive modifications. That really depends on exactly what you are trying to do however. Are you trying to run this with Sub Programs?

Link to comment
Share on other sites

I would recommend calling your Reseller for help setting this up. I have no idea what you are trying to do with capturing the home positions, but the "undesired" code is coming from the Tool Change Post Block. MPLMaster uses a different Post Block structure from CNC Software's Generic Posts.

 

We do have a Generic Mori Seiki Post available for Lathe, that shouldn't require such extensive modifications. That really depends on exactly what you are trying to do however. Are you trying to run this with Sub Programs?

 

Thanks for the replies, I will try to be more specific, perhaps my question should have been …

 

Am I using the vequ() function properly to capture the zh$ in the line of code zhome = vequ(zh$) ?

Why does “zhome = vequ(zh$)” cause the tool change post block to output the “undesired” code?

Eliminating that line of code (or using zhome= vequ(xh$) to get the X home value) eliminates the problem.

 

In an attempt to answer your questions…

 

The only subs we use are for the locations of holes in C axis drilling type operations.

 

Our post processors have worked fine with our different lathes for quite some time. We are satisfied with them for now but would be open to better methods.

 

I recently encountered this problem when I added an error check for certain values including the X and Z home values. It checks each operation to be sure they were entered correctly. These checks work ok except for the output of “undesired code”. This error check is similar to code done by Paul Decelles from CNC Software in the “POST TRICK” thread entry Posted 10 February 2011 - 04:45 PM.

 

Thanks again.

Link to comment
Share on other sites

Ah, ok I see your problem.

The function vequ() is a Vector Math function. The function always loads values into three variables. By starting with 'zh$', you are copying the values from 'zh$' first, then the values of the next two variables after 'zh$' into two other variables. These variables that are getting loaded with values are the next two variables initialized after 'zhome'. One of these variables is probably a Command Variable that is causing the Post to call the tool change or SOF post block.

 

Why are you using Vector Equate? Just set 'zhome = zh$' and be done.

 

The alternative is to use an implied array, and copy the values into the array properly, as three variables.

 

xhome : 0

yhome : 0

zhome : 0

 

xhome = vequ(xh$)

 

That will load the value from zh$ into zhome, without stepping on any other variables by accident.

 

Hope that helps,

Link to comment
Share on other sites

Ah, ok I see your problem.

The function vequ() is a Vector Math function. The function always loads values into three variables. By starting with 'zh$', you are copying the values from 'zh$' first, then the values of the next two variables after 'zh$' into two other variables. These variables that are getting loaded with values are the next two variables initialized after 'zhome'. One of these variables is probably a Command Variable that is causing the Post to call the tool change or SOF post block.

 

Why are you using Vector Equate? Just set 'zhome = zh$' and be done.

 

The alternative is to use an implied array, and copy the values into the array properly, as three variables.

 

xhome : 0

yhome : 0

zhome : 0

 

xhome = vequ(xh$)

 

That will load the value from zh$ into zhome, without stepping on any other variables by accident.

 

Hope that helps,

 

That was it, made the changes and worked perfect.

 

I corrected the use of vequ() but then eliminated it in favor of the simpler xhome = xh$ and zhome = zh$.

 

Good help, thanks.

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