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:

Post mod question


Bob W.
 Share

Recommended Posts

I would like to modify my post so that the tool diameter is set in macro variable #550 right after a tool change. For example, if tool 5 is a .250" end mill the posted code would read:

 

T5 M6

#550 = 0.25000 (TOOL DIAMETER INTO VARIABLE 550)

#551 = #4120 (TOOL NUMBER VARIABLE SET)

 

I already have the tool number working but need help with the diameter. I am using this for tool setting logic for shell mills versus small tools. The tool number is set so I have a good value before the stagetool call. This is for a Makino HMC with a Fanuc 31i control and my current post is based on mpmaster.

 

Thanks,

Bob

Link to comment
Share on other sites
pbld, n$, "#550=", diameter, e$

 

I tried that and got errors. How would I incorporate that into my post? I'm not an expert on post processors but I can usually get by.

 

What errors did you get? Do you have the following code in your pparameters$ post block?

 

   		if prmcode$ = 20004, slot = rpar(sparameter$, 16)

 

If you do you should also have the formatting of "diameter":

 

fmt 	2 slot                	# 20004 Parameter line
fmt 	2 tool_type
fmt 	2 matl_type
fmt 	2 corner_rad_type
fmt 	2 diameter #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
fmt 	2 corner_rad
fmt 	2 threads
fmt  A  2 tip_angle
fmt 	2 dia_off
fmt 	2 len_off
fmt 	2 tool_feed
fmt  F  15 plunge
fmt  F  15 retract
fmt 	2 rpm
fmt 	2 coolant1
fmt 	2 n_flutes1
fmt  A  2 tip_angle_ch

Link to comment
Share on other sites

What errors did you get? Do you have the following code in your pparameters$ post block?

 

   		if prmcode$ = 20004, slot = rpar(sparameter$, 16)

 

If you do you should also have the formatting of "diameter":

 

fmt 	2 slot                	# 20004 Parameter line
fmt 	2 tool_type
fmt 	2 matl_type
fmt 	2 corner_rad_type
fmt 	2 diameter #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
fmt 	2 corner_rad
fmt 	2 threads
fmt  A  2 tip_angle
fmt 	2 dia_off
fmt 	2 len_off
fmt 	2 tool_feed
fmt  F  15 plunge
fmt  F  15 retract
fmt 	2 rpm
fmt 	2 coolant1
fmt 	2 n_flutes1
fmt  A  2 tip_angle_ch

 

I don't have either of those lines in my post. When I added them I get the error "label has not been defined", "label was expected but not found". These were related to the line "if prmcode$ = 20004, slot = rpar(sparameter$, 16)"

Link to comment
Share on other sites

pbld, n$, 35, no_spc$, "550", no_spc$, 61, tldia, e$

 

35 = the ascii value of #

61 = ascii value of =

no_spc$ is a system variable that allows no spacing between output characters.

 

HTH

 

I tried that John, but the tldia still posts as "TOOL DIAMETER - .250" due to formatting of the tldia variable in the formatting section. So the posted code reads:

 

#550=TOOL DIAMETER - .250

Link to comment
Share on other sites

Hi Bob,

 

You have two choices available to fix the problem: create a new user-defined variable, or use the 'new address' function to override the formatting for the output.

 

To create a new variable, find the format assignment section and add some code like this:

 

fmt "#501=" 2 tool_diameter #Tool Diameter variable output

 

Then, before the output line, assign the variable value:

 

     tool_diameter = tldia
     pbld, n$, tool_diameter, e$

Link to comment
Share on other sites

Hi Bob,

 

You have two choices available to fix the problem: create a new user-defined variable, or use the 'new address' function to override the formatting for the output.

 

To create a new variable, find the format assignment section and add some code like this:

 

fmt "#501=" 2 tool_diameter #Tool Diameter variable output

 

Then, before the output line, assign the variable value:

 

     tool_diameter = tldia
     pbld, n$, tool_diameter, e$

 

Still getting errors. Is there anything else I need to do?

Link to comment
Share on other sites

Anytime Bob, glad it is working for you.

 

What I am doing is setting up my probing macros so that if the tool diameter is .375" or smaller it will run probing and break detect routines 'A' and if the tool is bigger than .375" it will run probing and break detect routines 'B' where the tool is offset and run in reverse during probing. The Makino has multiple block skip (/1 - /9) so the probing routines post at every tool change and they can be turned on and off on the fly while the program is running. It is a pretty slick option if you ask me :-). The tools are always set during the first program cycle, then the tool setting routine is skipped going forward.

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