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:

Tool Type Determination


Recommended Posts

Our machine is currently only measuring a flat endmill via the posted code. The call to this macro is P9623. I am trying to get the post to pull the tool type (20004 parameter) put it into my user defined variable and use a string selector to output the corresponding tool measuring macro (P9623 etc.). I do not get the correct output out of the string selector. The value going in is at the moment a type_tool of 10, but I am not getting anything out. Until it is solidly decided what each tool type's macro is I have placed their names in the string for now. It seems like it is stopping at the string selector. Anyone know what I am doing wrong?

 

Parameter page from Reference Guide:

20004:Tool definition: tool parameters

20004

1 2 3 4 5 6 7 8 9 10 11 12 16 14 15 19 17 18

  1. tool number
     
  2. tool type:

1 = center drill

2 = spot drill

……

10 = end mill - flat

……

 

pparameter$ #Read operation parameters

if prmcode$ = 20004, type_tool = rparsngl(sparameter$, 2)

 

type_tool : 0

 

#tool type for tool length measurement

tp00 : "CENTER DRILL"

tp01 : "SPOT DRILL"

tp02 : "DRILL"

tp03 : "RIGHT HAND TAP"

tp04 : "LEFT HAND TAP"

tp05 : "REAMER"

tp06 : "BORING BAR"

tp07 : "COUNTER BAR"

tp08 : "COUNTER SINK"

tp09 : "END MILL - FLAT" eventually will be "P9623"

tp10 : "END MILL - SPHERICAL"

tp11 : "CHAMFER MILL"

tp12 : "FACE MILL"

tp13 : "SLOT MILL"

tp14 : "RADIUS MILL"

tp15 : "DOVETAIL MILL"

tp16 : "TAPERED MILL"

tp17 : "LOLLIPOP MILL"

tp18 : "BULLNOSE"

stype_tool : ""

 

fstrsel tp00 type_tool stype_tool 19 -1

Link to comment
Share on other sites

The variables in the string select table must be defined as strings.

 

Try this:

 

#tool type for tool length measurement

stp00 : "CENTER DRILL"

stp01 : "SPOT DRILL"

stp02 : "DRILL"

stp03 : "RIGHT HAND TAP"

stp04 : "LEFT HAND TAP"

stp05 : "REAMER"

stp06 : "BORING BAR"

stp07 : "COUNTER BAR"

stp08 : "COUNTER SINK"

stp09 : "END MILL - FLAT" eventually will be "P9623"

stp10 : "END MILL - SPHERICAL"

stp11 : "CHAMFER MILL"

stp12 : "FACE MILL"

stp13 : "SLOT MILL"

stp14 : "RADIUS MILL"

stp15 : "DOVETAIL MILL"

stp16 : "TAPERED MILL"

stp17 : "LOLLIPOP MILL"

stp18 : "BULLNOSE"

stype_tool : ""

 

fstrsel stp00 type_tool stype_tool 19 -1

 

You can also use the variable tool_typ$ if you want so you do not have to read the parameter number.

Link to comment
Share on other sites

Is the first tool used a flat endmill?

 

There is an issue with the one string variable declaration.

 

stp09 : "END MILL - FLAT" eventually will be "P9623" <-- There are too many quotation marks and characters outside the quotation marks.

 

Change to something like this:

stp09 : "END MILL - FLAT eventually will be P9623"

OR

stp09 : "END MILL - FLAT" #eventually will be "P9623"

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