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:

MR9$ and MR10$ in POCKET - WEAR


Recommended Posts

Hello everyone,
   I am currently using MAKINO CELL SYSTEM which does not allow user to manual input the H WEAR and COMP WEAR at the control.   So, so I am trying to write the post of which using G10 for H Wear and COMP.  

   I am almost there but not 100% there because of the pocket feature as COMPUTER - WEAR.  I am trying to call out the "WEAR" from POCKET and failed.  I also debugged it but not successful.  Would you guys please tell me what I've done wrong?  

 

PS: Please screen images

 

Thank you.

================ G-CODES ================
 

%
O1302(10326 MWM2400-2500-25 REVA- OP1.NC)
DEBUG =  opcode$ 4. op_id$ 6. tool_op$ 3.  ============> I debugged this in POCKET toolpath as COMPUTER
N3( .2500,1/4 EM, CB, USED TOOL,)
(3FLTS .625LOC, .75STO)
G0 G17 G40 G49 G80 G90
G91 G28 Z0 M19
G28 Y0 
T3 M6(FINISH POCKET, CUT#10)
G90 G54 X0. Y0.
S8500 M3
(.0875 STEPOVER, 1X, .005 FINISH)
G90 G10 L11 P3 R.0002(H WEAR) ======> GOOD CODE
G43 H3 Z1. M8(DOC= Z-.69)
Z.0625
G1 Z-.69 F25.
X.011
G3 X-.0547 R.0328
X.0985 R.0766
(CUTTING...)
Y-.025
G3 X-1.2999 Y-.0625 R.075
G1 X-1.2124 Y-.214
G0 Z1.
G90 G10 L11 P3 R0.(H WEAR 0) ======> GOOD CODE

DEBUG =  opcode$ 4. op_id$ 99. tool_op$ 3.============> I debugged this in POCKET toolpath as WEAR
(*)
N302(FINISH POCKET, CUT#11)
G90 G10 L11 P3 R.0002(H WEAR)======> GOOD CODE
G90 G10 L13 P3 R.0001(COMP)" ==========> MISSING, IT SHOULD APPEAR HERE
T3 M6( .2500,1/4 EM, CB, USED TOOL,)
(3FLTS .625LOC, .75STO)
G0 G90 G54 Z5.
X0. Y0. S8500 M3
G43(D3)H3 Z1.(DOC= Z-.69)
(.0875 STEPOVER)
Z.0625
G1 Z-.69
X.011
G3 X-.0547 R.0328
(CUTTING)
X-1.31 Y.6496
Y-.025
G3 X-1.2999 Y-.0625 R.075
G1 G40 X-1.2124 Y-.214
G0 Z1.
G90 G10 L11 P3 R0.(H WEAR 0)======> GOOD CODE
G90 G10 L13 P3 R0.(COMP 0)" ==========> MISSING, IT SHOULD APPEAR HERE
DEBUG =  opcode$ 4. op_id$ 99. tool_op$ 3.
M9
G91 G28 Z0.
/G28 Y0.
M5
G0 G90 G54 X0.
M30(4,415CHARS - 4.43KB)
%

 

============== Post ================
 

#Region pHWearReset
pHWearReset
  if mr9$ <> 0,
   [
    g10tool = tloffno$ #assign current tool number
    if g10tl_len <> zero | g10tl_len = zero,
     [
      pbld, no_spc$, "G90", "G10", "L11", *g10tool, "R0.", spaces$ = 0, "(H WEAR 0)", spaces$ = sav_spc, e$
      !mr9$
     ]
     if g10tl_len <> zero & g10tl_dia = zero, g10mode = one #Length Only
     if g10tl_dia <> zero & g10tl_len = zero, g10mode = two #Diameter Only
     if g10tl_len <> zero & g10tl_dia <> zero, g10mode = three #Both length and diameter are active
   ] 
#EndRegion

#Region pCompReset
pCompReset
 "DEBUG = ", ~opcode$, ~op_id$, ~tool_op$, e$
if (mr10$ = 0 | mr10$ <> 0),
  if not(op_type_hsm) & opcode$ = 4,
    [
    g10tool = tloffno$ #assign current tool number
    if g10tl_dia <> zero | g10tl_dia = zero,
     [
      pbld, no_spc$, "G90", "G10", "L13", *g10tool, "R0.", spaces$ = 0, "(COMP RESET 1000)", spaces$ = sav_spc, e$
      !mr10$ = 0
      if (g10tl_len <> zero | g10tl_len = zero) & g10tl_dia = zero, g10mode = one #Length Only
      if (g10tl_dia <> zero | g10tl_dia = zero) & g10tl_len = zero, g10mode = two #Diameter Only
      if (g10tl_len <> zero | g10tl_len = zero) & g10tl_dia <> zero, g10mode = three #Both length and diameter are active        
     ]
    ]
#EndRegion

#Region pHwear
pHwear
 if mr9$ <> 0,
  [
   g10tool = tloffno$ #assign current tool number
   if g10tl_len <> zero | g10tl_len = zero,
    [
     pbld, no_spc$, "G90", "G10", "L11", *g10tool, *g10tl_len, spaces$ = 0, "(H WEAR)", spaces$ = sav_spc, e$
     !mr9$
    ]
     if g10tl_len <> zero & g10tl_dia = zero, g10mode = one #Length Only
     if g10tl_dia <> zero & g10tl_len = zero, g10mode = two #Diameter Only
     if g10tl_len <> zero & g10tl_dia <> zero, g10mode = three #Both length and diameter are active
  ]
#EndRegion

#Region pCompActive
pCompActive
 if comp_type = two & tool_typ$ > 9 & (mr10$ <> 0 | mr10$ = 0),
  [
   g10tool = tloffno$ #assign current tool number
   if g10tl_dia <> zero | g10tl_dia = zero,
    [
     pbld, no_spc$, "G90", "G10", "L13", *g10tool, *g10tl_dia, spaces$ = 0, "(COMP)", spaces$ = sav_spc, e$
     !mr10$ = 0
	]
    if (g10tl_len <> zero | g10tl_len = zero) & g10tl_dia = zero, g10mode = one #Length Only
    if (g10tl_dia <> zero | g10tl_dia = zero) & g10tl_len = zero, g10mode = two #Diameter Only
    if (g10tl_len <> zero | g10tl_len = zero) & g10tl_dia <> zero, g10mode = three #Both length and diameter are active        
  ]
#EndRegion

#Region pCompActive2
pCompActive2	  
 if mr10$ <> 0 & not(op_type_hsm) & cc_pos$ > 0,
  [
   g10tool = tloffno$ #assign current tool number
   if g10tl_dia <> zero | g10tl_dia = zero,
    [
     pbld, no_spc$, "G90", "G10", "L13", *g10tool, *g10tl_dia, spaces$ = 0, "(COMP)", spaces$ = sav_spc, e$
     !mr10$ = 0
    if (g10tl_len <> zero | g10tl_len = zero) & g10tl_dia = zero, g10mode = one #Length Only
    if (g10tl_dia <> zero | g10tl_dia = zero) & g10tl_len = zero, g10mode = two #Diameter Only
    if (g10tl_len <> zero | g10tl_len = zero) & g10tl_dia <> zero, g10mode = three #Both length and diameter are active        
    ]
  ]
  mr10$ = 0
#EndRegion


 

#Region Null tool change
ptlchg0$         #Call from NCI null tool change (tool number repeats)
      pcom_moveb
      pcheckaxis      #Check for valid rotary axis
      c_mmlt$ #Multiple tool subprogram call
      comment$

      pHWearReset ============> Call out to here
      pCompReset ============> Call out to here

      "(*)", e$ # Second star, end of toolpath
      if nextdc$ <> 13, *ToolSequenceNumber, no_spc$, #No Tool Change

        if mr3$ = 1,
         [
          if nextdc$ <> 13, spaces$ = 0,  ptoolcomment , spaces$=sav_spc #No Tool Change
         ]
        spaces$ = 0, scomm_str, *scomm_sav, ", CUT#", *sToolPathNumber, scomm_end, spaces$=sav_spc, e$
        if MaxRoughDepth > 0 & (opcode$ = 1 | opcode$ = 2 | opcode$ = 4 | opcode$ > 16), NumberOfRoughDepthCuts = (abs(operation_depth)+ abs(BreakThroughAmount))/MaxRoughDepth
      #if not(tool_op$ = 18), pMultiPass
      #if tool_op$ = 18, pCircleMill
      #pbld, no_spc$, "G43", pfzout, #NO TOOL CHANGE
      if cinc, pbld, "G91 G28 Z0.(ROTATING TO,", *sconstplname, no_spc$, ")", e$
	  #[if swcsplname <> stoolplname, pbld, "G91 G28 Z0.(FULL RETRACT WHEN ROTATE)", e$]

     pHwear ============> Call out to here
     pCompActive ============> Call out to here
     pCompActive2 ============> Call out to here
#EndRegion

 
#Region Retract at end of tool path, reference return
pretract        #End of tool path, toolchange
      #"DEBUG: PRETRACT",e$

    if no_nc_out$,
    [
    no_nc_out$ = zero
    z_clear_flg = one
    z_clear = OpClrPlane
    ]

      if xform_type,
        [
        bld = zero #Turn off block delete on retract motion
        sm09_0, no_spc$, "(XFORM USED)", e$
        ]
		
   pHWearReset ============> Call out to here
   pCompReset ============> Call out to here

     sav_mr6 = zero
      phsm_off
      sav_absinc = absinc$
      absinc$ = one


      sav_coolant = coolant$
      coolant$ = zero
#EndRegion

MISC VALUE.jpg

POCKET COMPENSATION - COMPUTER.jpg

POCKET COMPENSATION - WEAR.jpg

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