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:

Add Comp Macro post?


Recommended Posts

Merry Christmas to all,

I want to add a comp macro to our post so that we will not forget to enter a comp value in the register when needed, we program online so if we forget we make BIG holes or small Blocks.

the code lookes like:

 

 

 

 

N4T4M6(2" INCH COMP= RAD.)

Y_[1]=$TC_DP6[$TC_MPP6[9998,1],1]*1

IF(Y_[1]>1.01)GOTO N5555 tool radius +.01

IF(Y_[1]<.99)GOTO N5555 tool radius -.01

 

 

 

 

G49G53Z0.Y0.X-18.M9

GOTO N6666

N5555SETAL(65000)

M00;CUT COMP ERROR

N6666

 

I want this tied to G41 /G42 so it is only output on tools with comp

I believe I can Force All the code and the ±.01 , if I knew where in the post "Comp" and "Tool Radius" is?

Thanks Forum

Link to comment
Share on other sites

Hi there.

In your post initialize this variable in case it is not:

fmt 2 tlrad$ #tool radius format

Then at "ptlchg_com" , after your M06 add this lines:

spaces$ = 0

pbld, "CHECK_RAD(", *tlrad$, ")",e$

spaces$ = 1

On machine create this user cycle called "CHECK_RAD" :

PROC CHECK_RAD(REAL TOOL_RAD, REAL _TOL)

DEF REAL FACTOR_SCALING

DEF REAL ACTUAL_TOOL_NR

DEF REAL _TOL_UP

DEF REAL _TOL_DOWN

IF $MN_SCALING_SYSTEM_IS_METRIC==0

FACTOR_SCALING=$MN_SCALING_VALUE_INCH

ELSE

FACTOR_SCALING=1

ENDIF

ACTUAL_TOOL_NR=$TC_DP6[$TC_MPP6[9998,1],1] ;CAPTURE TOOL RAD IN SPINDLE

IF _TOL==0

_TOL=0.254/FACTOR_SCALING ;DEFAULT VALUE FOR TOLERANCE IN MM

ENDIF

_TOL_UP=TOOL_RAD+_TOL

_TOL_DOWN=TOOL_RAD-_TOL

IF (ACTUAL_TOOL_NR>_TOL_UP)OR(ACTUAL_TOOL_NR<_TOL_DOWN) GOTOF _ALLARM

_END: M17

_ALLARM:SETAL(65000)

M00 ;CUTTER COMP ERROR

M30

What will happen:

after each tool change your post will add a line

CHECK_RAD(tool_rad) where tool_rad= your active tool radius

the cycle wich I made 4U will check that your posted value for that tool and the value of the actual tool in spindle differ with a default value(0.254mm /see the custom cycle.)

Also you can manually modify the tolerance value by adding the new value after the tool rad like this

CHECK_RAD(1,0.02)

1=tool rad to be checked

0.02= new tolerance/in current measuring system /in or mm G700 OR G710

Let me know if U have some difficulties

Edited by Griveous74
  • Like 1
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...