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:

Repeating tool path comments when extracting parameter 15239


Recommended Posts

The task is to create a tool/op sheet showing all the ops under a specific tool. I'm trying to extract the tool path comment for each op of each tool. The problem I have is the tool comment repeats for each chain of a milling op and/or ops with multiple passes and depth of cuts but is fine on drilling. I use the parameter lookup in my ptooltable$ logic. The below has an op using T91 that has 2 radial passes and 2 step depths which ends up outputting RGH .400 SLOT four times when I only want one to represent the actual name of the op. Any suggestions?

what it is:

T91 | N9100 | | 3/16" 3FL. CARB ENDMILL .015 RAD | H91
RGH .400 SLOT | D91 |
RGH .400 SLOT
RGH .400 SLOT
RGH .400 SLOT

what is should be:

T91 | N9100 | | 3/16" 3FL. CARB ENDMILL .015 RAD | H91

RGH .400 SLOT | D91 |

 

code pertaining to sopcomment:

fprmtbl 101 7    #Operation - tool table
     1013      sparameter$
     15239    sopcomment
     15346    comp_type
     20001    strtool$
     10094    sdescriptfield
     20021    supmf_id
     15240    op_num

ptooltable$
     if tool_info > 1,                                                                            # tool_info is initalized to 3 which puts Tooltable in header - with tool comments at T/C
        [
        result = fprm(101, 0, 0)                                                         # get the data from parameter lookup
        pgettoolinfo
      
        s_t_pre_tt = s_t_pre$, s_d_pre_tt = s_d_pre$,              # Copy prefix string for Tool number and cutter comp number
        s_h_pre_tt = s_h_pre$                                                          # Copy prefix string for Tool length offset
      
        # Output tooltable line

           if tt_state$ = 1 | tt_tool$ <> tool_prev,
              [
              "                                                                                                                                                ", e$
               n$ = tt_tool$ * 100
               *tt_tool$, sdelimiter, *n$, sdelimiter,*supmf_id, sdelimiter, pstrtool, sdelimiter, *tt_tlngno$, e$
                    if tt_drlcycle$ = -1 & comp_type > 0  &  comp_type < 4,
                        [
                        sopcomment, sdelimiter, *tt_offset$, sdelimiter, *scomp_type, e$
                         ]
                    else,
                        [
                        sopcomment, e$
                        ]
              ]
           else,
              [
               sopcomment, e$
              ]          
        ]

 

 

 

Link to comment
Share on other sites

Try this:

ptooltable$
     if tool_info > 1,         # tool_info is initalized to 3 which puts Tooltable in header - with tool comments at T/C
        [
        result = fprm(101, 0, 0)                                                         # get the data from parameter lookup
        pgettoolinfo
      
        s_t_pre_tt = s_t_pre$, s_d_pre_tt = s_d_pre$,              # Copy prefix string for Tool number and cutter comp number
        s_h_pre_tt = s_h_pre$                                                          # Copy prefix string for Tool length offset
      
        # Output tooltable line

           if tt_state$ = 1 | tt_tool$ <> tool_prev,
              [
              *e$
              n$ = tt_tool$ * 100
              *tt_tool$, sdelimiter, *n$, sdelimiter,*supmf_id, sdelimiter, pstrtool, sdelimiter, *tt_tlngno$, e$
              if tt_drlcycle$ = -1 & comp_type > 0  &  comp_type < 4,
                [
                sopcomment, sdelimiter, *tt_offset$, sdelimiter, *scomp_type, e$
                ]
              else,
                [
                sopcomment, e$
                ]
              ]
           else,
              [
               # sopcomment, e$    -------> comment this line out
              ]      
        ]

Greetz,

Jan

  • Like 1
Link to comment
Share on other sites

I gave it a shot and it outputs the tool info and only the first tool path comment. In the example toolpath above (T91), it worked as far as one op, one output but when I had a tool with 3 ops, it only output the first tool path comment. Almost there.

Link to comment
Share on other sites

With this you know where the problem is. I would add a variable to the system:

op_num_prev 		: 0		#Variable to store the previous op_num for ptoolcommend

Next we have to edit the last else statement:

ptooltable$
     if tool_info > 1,         # tool_info is initalized to 3 which puts Tooltable in header - with tool comments at T/C
        [
        result = fprm(101, 0, 0)                                                         # get the data from parameter lookup
        pgettoolinfo
      
        s_t_pre_tt = s_t_pre$, s_d_pre_tt = s_d_pre$,              # Copy prefix string for Tool number and cutter comp number
        s_h_pre_tt = s_h_pre$                                                          # Copy prefix string for Tool length offset
      
        # Output tooltable line

           if tt_state$ = 1 | tt_tool$ <> tool_prev,
              [
              *e$
              n$ = tt_tool$ * 100
              *tt_tool$, sdelimiter, *n$, sdelimiter,*supmf_id, sdelimiter, pstrtool, sdelimiter, *tt_tlngno$, e$
              if tt_drlcycle$ = -1 & comp_type > 0  &  comp_type < 4,
                [
                sopcomment, sdelimiter, *tt_offset$, sdelimiter, *scomp_type, e$
                ]
              else,
                [
                sopcomment, e$
                ]
              ]
           else,
              [
              if op_num_prev <> op_num, # Add this if statement to check to previous operation number
                [
                sopcomment, e$ 
                ]
              ] 
           op_num_prev = op_num #update op_num_prev
        ]

Also note that every time the added variable is updated in the second to last line.

The first if statement after # output tooltable line: if tt_state$ =1 | tt_tool$ <> tool_prev, checks for first tool or if tool is unequal for previous tool. Therefore op_num_prev is not used at before updating it.

The added if statement check is the op_num_prev is unequal to current op_num. This should eliminate the extra sopcomments from a toolpath and adding it when there is a new toolpath. 

Greetz,

Jan

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