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:

Duplicated value in tool table


Recommended Posts

Hey friends,

I looked around and didn't see a thread that addressed this problem, feel free to direct me if this is a duplicate.

I am trying to clean up our lathe post processor  and one of the annoying things it does is that sometimes, not always, it duplicates the last tool entry in my tool table. I can't find what controls this process or why some programs have the problem and some don't.

My code for the tool table is:

ptooltable # Write tool table, scans entire file, null tools are negative
           tnote = t$
           toffnote = tloffno$
           tlngnote = tlngno$
           spaces$=0
           if t$ >= zero,
             [
             "(", *t$, " | ", plistcomm, ")"
             ]
           spaces$=sav_spc

 

Which produces the following tool table in my program:

(T1 | R .032 OD ROUGH RIGHT)
(T2 | R .016 OD FINISH RIGHT)
(T5 | OD THREAD RIGHT)
(T12 | .118 PART OFF BLADE)
(T12 | .118 PART OFF BLADE)

 

Any suggestions on how to stop it from duplicating the last tool?

Many Thanks!

Link to comment
Share on other sites

The output from your Post is based on the codes in the NCI File.

The value of 'gcode$' changes all the time, while the NCI File is being processed.

At the 1st tool change 'gcode$ = 1001'.

At a "Null" Tool change 'gcode$ = 1000'. (Tool number repeats.)

At an "Actual" Tool change 'gcode$ = 1002'. (Tool number switches to "new" tool number".)

At the "End of File", this is the last tool change, 'gcode$ = 1003'.

 

So the logic condition 'gcode$ <> 1003', is read as "if the value of 'gcode$' does not equal '1003', then the statement is true."

 

  • Thanks 1
  • Like 5
Link to comment
Share on other sites

Colin, I really like your explanation. It is well organized and easy to follow.

Regarding gcode$ = 1003, I would make one small change in your wording to avoid confusion.

gcode$ = 1003 indicates the end of the file. It is what happens after the last operation. It is not the last tool change because it is not a tool change at all.

  • Thanks 1
  • Like 1
Link to comment
Share on other sites
6 minutes ago, Alex Dales said:

Colin, I really like your explanation. It is well organized and easy to follow.

Regarding gcode$ = 1003, I would make one small change in your wording to avoid confusion.

gcode$ = 1003 indicates the end of the file. It is what happens after the last operation. It is not the last tool change because it is not a tool change at all.

While you are "technically" correct on that Alex, I mention it that way, because of the way the "end of file" is processed. True, it is not a 'Tool Change' event, but it gets processed "through" the 'ptooltable' during the Pre-Read loop. And, as we can see from the original thread, it requires logic to suppress the duplicate output. The reality is that we get a duplicate output of the tool, when processing the "end of file" through the Pre-Read loop. So the effect is that of a "tool change event", in terms of diagnosing the issue with the Tool Table.

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