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:

Help with D## output


Recommended Posts

I have modified my Okuma post logic to output G56 HA if tlngno$ = 10001 | tlngno$ = t$. Further more it will output G56 HB if tlngno$ = 10002 and G56 HC if tlngno$ = 10003. Here is the code

ptlen           #Tool length offset
      
        if tlngno$ = 10001 | tlngno$ = 10002 | tlngno$ = 10003 | tlngno$ = t$,
          [
           if tlngno$ = 10001 | tlngno$ = t$, *sg56, "HA"
           if tlngno$ = 10002, *sg56, "HB"
           if tlngno$ = 10003, *sg56, "HC"
          ]
        else, *sg56, *tlngno$
        !tlngno$

However, I cannot for the life of me get it to work the same for the cutter comp without getting the output on every line

pccdia          #Cutter Compensation
      #Force Dxx#   
      if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k
      sccomp
      #if cc_pos$, tloffno$
      if cc_pos$, ptoff


ptoff           #Tool radial offset
      
        if tloffno$ = 10001 | tloffno$ = 10002 | tloffno$ = 10003 | tloffno$ = t$,
          [
           if tloffno$ = 10001 | tloffno$ = t$, "DA"
           if tloffno$ = 10002, "DB"
           if tloffno$ = 10003, "DC"
          ]
        else, *tloffno$
        !tloffno$

Here is the posted code:

N1 ( 1/2 FLAT ENDMILL )
G90 G17 G80 G40 G00
G30 P10
G116 T1
G15 H2
G131 F1260. J1 E.002
G00 G94 G90 X-2.4 Y-.1
S5000 M03 T2
G56 HA Z1. M08
G01 Z-1. F30.
G41 DA X-2.35
G03 DA X-2.25 Y0. I0. J.1
G01 DA Y1.5
G02 DA X-2. Y1.75 I.25 J0.
G01 DA X2.
G02 DA X2.25 Y1.5 I0. J-.25
G01 DA Y-1.5
G02 DA X2. Y-1.75 I-.25 J0.
G01 DA X-2.
G02 DA X-2.25 Y-1.5 I0. J.25
G01 DA Y0.
G03 DA X-2.35 Y.1 I-.1 J0.
G01 G40 X-2.4
G00 Z1.
G130
G131 F1260. J1 E.002
G00 Y-.1
G01 Z-1.
G41 DB X-2.35
G03 DB X-2.25 Y0. I0. J.1
G01 DB Y1.5
G02 DB X-2. Y1.75 I.25 J0.
G01 DB X2.
G02 DB X2.25 Y1.5 I0. J-.25
G01 DB Y-1.5
G02 DB X2. Y-1.75 I-.25 J0.
G01 DB X-2.
G02 DB X-2.25 Y-1.5 I0. J.25
G01 DB Y0.
G03 DB X-2.35 Y.1 I-.1 J0.
G01 G40 X-2.4
G00 Z1.
M09
M05
G130
G30 P30
M01
 
N2 ( 1/8 DRILL )
G90 G17 G80 G40 G00
G30 P10
G116 T2
G15 H2
G00 G94 G90 X0. Y0.
S6000 M03 T1
G56 HA Z1. M51
G71 Z1.
G81 Z-1. R.1 F25. M53
G00
M09
M05
G30 P30
M02

What am I missing? If I do not use the ptoff logic and use the if cc_pos$, tloffno$ line in the pccdia post block it works as expected and only outputs on a single line with the numerical value. I know it is something simple that I am overlooking.

 

Thank you in advance.

Brad

Link to comment
Share on other sites
6 hours ago, jeff.D said:

In MP strings are non modal so the literal string will always be output.  This also applies to strings that are in a variable, for example sg56.  Adding the force leader (*) to sg56 is redundant, it will always be output.

Strings that require modality are usually set up in a string select table.

I understand that the *sg56 is redundant I just like to see it so I know it is forced without question. As for the D value if I use if

pccdia          #Cutter Compensation
      #Force Dxx#   
      if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k
      sccomp
      if cc_pos$, tloffno$

The D## only appears at the G41 line as a numerical value. But when I change that block to

pccdia          #Cutter Compensation
      #Force Dxx#   
      if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k
      sccomp
      if cc_pos$, ptoff

It puts the D## value on every line, although in the correct format that I'm looking for; DA, DB, DC or a numerical value. I just want to get rid of the redundant D## values, the G56 H## logic works perfect.

Link to comment
Share on other sites

Try setting them up in a string select table, like below.

tool_rad : 0

sDA       : "DA"      
sDB       : "DB"      
sDC       : "DC"
stool_rad : ""         #Target string

fstrsel sDA tool_rad stool_rad 3 -1

The change your ptoff post block to the below. 

ptoff           #Tool radial offset
      
        if tloffno$ = 10001 | tloffno$ = 10002 | tloffno$ = 10003 | tloffno$ = t$,
          [
           if tloffno$ = 10001 | tloffno$ = t$, tool_rad = 0
           if tloffno$ = 10002, tool_rad = 1
           if tloffno$ = 10003, tool_rad = 2
           stool_rad
           if op_id$ <> prv_op_id$, result = force(tool_rad, tool_rad)
          ]
        else, *tloffno$
        !tloffno$

You'll also have to add the force line (shown below) to the psof$ postblock

 result = force(tool_rad, tool_rad) 

 

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