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:

Multiple Tool offset options


Recommended Posts

Hey everyone,

 

I'm working on getting our Okuma post to be able to use the available offset options in the control (HA/DA. HB/HB, HC/DC). We had help getting this option for tool changes and null tool changes, however I'm trying to get it to work in between different ops with the same tool number. Here is an example of the logic in the ptlchg0 block:

      if tlngno$ > 1000 & tloffno$ > 1000,
        [
        if tlngno$ = 8000 & tloffno$ = 8000 & tlngno$ <> prv_tlngno$ & tloffno$ <> prv_tloffno$,
          [
          pbld, n$, "G56",  pfzout, "HB", "DB", scoolant, e$
          ]
        if tlngno$ = 9000 & tloffno$ = 9000 & tlngno$ <> prv_tlngno$ & tloffno$ <> prv_tloffno$,
          [
          pbld, n$, "G56",  pfzout, "HC", "DC", scoolant, e$
          ]
        ]
      else,
        [
        pbld, n$, "G56",  pfzout, "HA", "DA", scoolant, e$
        ]

As you can see, I'm trying to get it to recognize and output the new offset value only if it has changed. It's still posting out whatever offset value is active regardless if it was previously active or not. I may just be trying to put it in the wrong spot or maybe the logic just isn't right. Any help is always appreciated!

  • Like 1
Link to comment
Share on other sites

Hey everyone,

 

I'm working on getting our Okuma post to be able to use the available offset options in the control (HA/DA. HB/HB, HC/DC). We had help getting this option for tool changes and null tool changes, however I'm trying to get it to work in between different ops with the same tool number. Here is an example of the logic in the ptlchg0 block:

      if tlngno$ > 1000 & tloffno$ > 1000,
        [
        if tlngno$ = 8000 & tloffno$ = 8000 & tlngno$ <> prv_tlngno$ & tloffno$ <> prv_tloffno$,
          [
          pbld, n$, "G56",  pfzout, "HB", "DB", scoolant, e$
          ]
        if tlngno$ = 9000 & tloffno$ = 9000 & tlngno$ <> prv_tlngno$ & tloffno$ <> prv_tloffno$,
          [
          pbld, n$, "G56",  pfzout, "HC", "DC", scoolant, e$
          ]
        ]
      else,
        [
        pbld, n$, "G56",  pfzout, "HA", "DA", scoolant, e$
        ]

As you can see, I'm trying to get it to recognize and output the new offset value only if it has changed. It's still posting out whatever offset value is active regardless if it was previously active or not. I may just be trying to put it in the wrong spot or maybe the logic just isn't right. Any help is always appreciated!

 

What you are describing is a null tool change condition and the logic worked out for that should be all you need to get this to work. What is different than I am not able to wrap my brain around?

Link to comment
Share on other sites

That's what I thought, as well. A null tool change is just a new operation with the same tool, correct? Here is my current null tool change block. Near the end you should be able to see the logic for the offset options. 

ptlchg0$         #Call from NCI null tool change (tool number repeats)
      toolchng0 = one
      if op_id$ <> last_op_id,
        [
        rd_params$  # Read parameters - pparameter
        pmisccheck
        ]
      pcuttype
      toolcount = toolcount + 1
      if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)
      else, nexttool = first_tool$
      retractflg = 0
      if cuttype = 0 & last_cuttype <> 0, clampend_flg = 1
      if (mi10$ & (op_id$ <> last_op_id | (op_id$ = last_op_id & xform_op_id$ <> op_id$)))
        | ((tlplnno$ <> last_tlplnno | rotary_type$ <> last_rotary_type) & ret_on_indx)
        | (mr1$ = 2 & op_id$ <> last_op_id & mr2$ <> last_mr2),
        [
        phsm_off
        if mi10$,
          [
          pretract
          n$, *sm00, e$
          result = force(spdir2,spdir2)       #Force spindle output after M00
          result = force(speed,speed)         #Force speed output after M00          
          ]
        else, pretract0
        retractflg = 1
        ]
      else,
        [
        if mr1$ <> last_mr1 | mr2$ <> last_mr2, phsm_off
        if clampend_flg,
          [
          pbld, n$, pclamp, e$
          clampend_flg = 0
          ]
        ]

      pcom_moveb
      pcheckaxis      #Check for valid rotary axis
      c_mmlt$ #Multiple tool subprogram call
      comment$
      #pcomment3
      pcan
      if plane$ < 0 | opcode$ = 3 | opcode$ = 16, plane$ = 0
      if op_id$ <> last_op_id, pbld, n$, sgplane, e$
      pspindchng
      if coolant$ <> 0 & coolant$ <> sav_coolant & sav_coolant, pbld, n$, sm09, e$
      pbld, n$, scoolant, e$
      sav_coolant = coolant$
      if coolant$ = 1, sm09 = sm09_0
      if coolant$ = 2, sm09 = sm09_1
      if coolant$ = 3, sm09 = sm09_2
      if op_id$ <> last_op_id, pstock
      if sav_mi9 = 1, workofs$ = sav_workofs
      if (wcstype > one & workofs$ <> prv_workofs$) | (tlplnno$ <> last_tlplnno) | retractflg,
        [
        if convert_rpd$ = one,
          [
          gcode$ = one
          feed = maxfeedpm
          ipr_type = zero
          ]
        sav_absinc = absinc$
        absinc$ = zero
        pindex
        if retractflg,
          [
          if safe_index,
            [
            if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
            pbld, n$, pgear, e$
            pbld, n$, *sgcode, [if not(index), sgabsinc, pwcs], pfcout, pspindleout, e$
            if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
            pbld, n$, pfxout, pfyout, e$
            ]
          else,
            [
            if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
            pbld, n$, pgear, e$
            pbld, n$, *sgcode, [if not(index), sgabsinc, pwcs], pfcout, pfxout, pfyout, pspindleout, e$
            if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
            ]
          phsm1_on        #must remain before G56         
          #pbld, n$, pfzout, scoolant, e$  #"G56", "HA", "DA", #*tlngno$, *tloffno$,
#New tool offset logic *Offset #8000=HB/DB, 9000=HC/DC       #BJL 08/29/16
          if tlngno$ > 1000 & tloffno$ > 1000,
            [
            if tlngno$ = 8000 & tloffno$ = 8000,
              [
              pbld, n$, "G56",  pfzout, "HB", "DB", scoolant, e$
              ]
            if tlngno$ = 9000 & tloffno$ = 9000,
              [
              pbld, n$, "G56",  pfzout, "HC", "DC", scoolant, e$
              ]
            ]
          else,
            [
            pbld, n$, "G56",  pfzout, "HA", "DA", scoolant, e$
            ]
          ] 
        else,
          [
          if fmtrnd(prv_cabs) <> fmtrnd(cabs),
            [
            if safe_index,
              [
              if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
              pbld, n$, [if not(index), sgabsinc, pwcs], pfcout, e$
              if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
              pbld, n$, pfxout, pfyout, e$
              ]
            else,
              [
              if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
              pbld, n$, [if not(index), sgabsinc, pwcs], pfcout, pfxout, pfyout, e$
              if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
              ]			  
            pbld, n$, pfzout, e$
            ]
          else,
            [
            pbld, n$, sgabsinc, [if not(index), pwcs], pfxout, pfyout, pfzout, pcout, e$
            ]
          ]
        pe_inc_calc
        ps_inc_calc
        absinc$ = sav_absinc
        ]	
      if lock_codes = one & cuttype <> last_cuttype & cuttype > 0, pbld, n$, *sunlock, sunlockcomm, e$
      if cuttype = zero, ppos_cax_lin
      if lock_codes = one & cuttype <> last_cuttype & cuttype = 0 & fmtrnd(prv_cabs) = fmtrnd(cabs), pbld, n$, *slock, slockcomm, e$
      if gcode$ = one, plinout
      else, prapidout
      pcom_movea
      if retractflg = 0 & op_id$ <> last_op_id,  #output if not forced output above with the G43
        [
        if mr1$ <> 1 | (mr1$ = 1 & mr2$ <> last_mr2), phsm1_on
        ]
      c_msng$ #Single tool subprogram call
      plast
      toolchng0 = zero

This may be where my problem is, because it normally wouldn't output a new length or diameter offset unless forced to, or it saw a change in the toolplane of the next operation. When I added that logic to the very end, after the "if retractflg = 0" logic it then would output the tool offsets, even on every pass of a multi-pass contour. That's where I tried to add the conditions it being not equal to the previous. I hope that makes a little more sense. 

Link to comment
Share on other sites

Yes this is the problem with forcing the process. Why there is so much logic written in the post to control the needed output when it is and is not needed. That is the balance and that is where you need to make conditions statements and counters and sav_ logic and other things to help the post track certain activity to get the method you are after to work. As it is there is just a check logic, but not a check to a previous condition logic that would tell the post to not or to output what you are after for your output.

 

Look at this one line of code:

if (wcstype > one & workofs$ <> prv_workofs$) | (tlplnno$ <> last_tlplnno) | retractflg,

If all of this between the ( wcstype is greaert than one and wofkofs$ is greater or less, but not equal to prv_workofs$ ) is good and then if this between ( tplnno$ is greater or less, but not equal last_tlplnno ) and retractflg is not active, then everythign below this section of code can happen in that section.

 

The logic for the tool is placed right in that section and I don't see any logic telling the post how to handle recalls or identifiers as to what to do for calling of the same tool in an operation. I don't see any logic for op_id tracking that might be a good way to handle what you are trying to do. You got help adding what you needed before might be time to ask for some more to get it to what you need it.

 

Colin will hopefully chime in and give a better idea than I have just explained.

Link to comment
Share on other sites

That all makes perfect sense. I'm still really new to post editing - I've been able to make small edits here and there but there are a lot of things that I'm still working on understanding. Thanks for your help!

 

I was able to just now work it out, adding that logic inside the boolean for the retractflg and setting the last value of the offsets within plast. Here's my solution:

      if retractflg = 0 & op_id$ <> last_op_id,  #output if not forced output above with the G43
        [
        if mr1$ <> 1 | (mr1$ = 1 & mr2$ <> last_mr2), phsm1_on
        if tlngno$ > 1000 & tloffno$ > 1000, #New tool offset logic *Offset #8000=HB/DB, 9000=HC/DC       #FHC 02/27/17
          [
          if tlngno$ = 8000 & tloffno$ = 8000 & tlngno$ <> last_tlngno & tloffno$ <> last_tloffno,
            [
            pbld, n$, "G56",  pfzout, "HB", "DB", scoolant, e$
            ]
          if tlngno$ = 9000 & tloffno$ = 9000 & tlngno$ <> last_tlngno & tloffno$ <> last_tloffno,
            [
            pbld, n$, "G56",  pfzout, "HC", "DC", scoolant, e$
            ]
          ]
        else,
          [
          pbld, n$, "G56",  pfzout, "HA", "DA", scoolant, e$
          ]
        ]
      c_msng$ #Single tool subprogram call
      plast
      toolchng0 = zero

plast
      last_op_id = op_id$
      last_cuttype = cuttype
      last_rotary_type = rotary_type$
      last_tlplnno = tlplnno$
      last_mr1 = mr1$
      last_mr2 = mr2$
      last_mr3 = mr3$
      last_mr4 = mr4$
	  last_tlngno = tlngno$ #FHC 02/27/17
	  last_tloffno = tloffno$ #FHC 02/27/17
  • 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...