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:

Adding Haas macro variables into tool table


Recommended Posts

Hello all,

I am trying to add macro variables into my Haas post for my Next Gen controller. What I'm trying to add is the macro variables tied to the "tool type", "approximate length", approximate diameter", "edge height measure", and "probe type". I have been modifying the MPfan post. I will try to do my best explaining all the things I have done so far, as I believe I'm getting close...

Starting with my pwrttparam$ section of my post, added the following code:

if prmcode$ = 20007, my_holder_length = rparsngl(sparameter$, 13)
#Define holder overall length
if prmcode$ = 20007, my_holder_projection = rparsngl(sparameter$, 12)
#Define tool projection
if prmcode$ = 20004, my_tool_diameter = rparsngl(sparameter$, 5)
#Define tool diameter
if prmcode$ = 20004, my_tool_type = rparsngl(sparameter$, 2)
#Define tool type

The italics are my custom variables That I defined a the beginning of my post. Here is what these look like:

my_holder_length : 0  #Define holder overall length 
my_holder_projection : 0  #Define tool projection
my_tool_diameter : 0  #Define tool diameter
my_tool_type : 0  #Define tool type
my_probe_type : 0  #Define probe type 
my_tool_type_set : 0 #Define if tool type is set
my_edge_height : 0 #Define edge measure height

 

And here is my formatting i made for how I want it to post out:

fmt "#5180_ = " 2     my_total_holder #Custom note format
my_total_holder = my_holder_length + my_holder_projection #Custom note combination
fmt "#5000_ = " 4 my_tool_type     #Custom note format B
fmt "#5200_ = " 3 my_tool_diameter #Custom note format D
fmt "#5260_ = " 4 my_probe_type    #Custom note format C
fmt "#5220_ = " 2 my_edge_height   #Custom note format K

The underscore is where I would have to manually change the underscore for the proper tool number.  For example, for tool one, the correct  macro variable for "tool type"  would be #50001.  Now having to change the underscore myself isn't my biggest concern, although if anyone has ideas on how they can be sequential per tool that would be really cool!  This will make more sense later when I show my post.

Next is the changes I made to my ptooltable. 

[if my_tool_type_set < 1,]
[if my_tool_type = 1, my_tool_type = 5, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,]
[if my_tool_type = 2, my_tool_type = 5, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 3, my_tool_type = 1, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 4, my_tool_type = 2, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,]
[if my_tool_type = 5, my_tool_type = 2, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 6, my_tool_type = 1, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 7, my_tool_type = 4, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 8, my_tool_type = 4, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 9, my_tool_type = 1, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 10, my_tool_type = 4, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 11, my_tool_type = 6, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 12, my_tool_type = 1, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 13, my_tool_type = 3, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 14, my_tool_type = 4, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 15, my_tool_type = 1, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 16, my_tool_type = 4, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 17, my_tool_type = 6, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 18, my_tool_type = 6, my_tool_type_set = 1, my_tool_type, e$]
[if my_tool_type_set < 1,] 
[if my_tool_type = 19, my_tool_type = 4, my_tool_type_set = 1, my_tool_type, e$]
       
       
my_tool_diameter, e$
my_total_holder, e$
       
[if my_tool_type = 1, my_probe_type = 2, my_probe_type, e$]
[if my_tool_type = 2, my_probe_type = 2, my_probe_type, e$]
[if my_tool_type = 3, my_probe_type = 1, my_probe_type, e$]
[if my_tool_type = 4, my_probe_type = 3, my_probe_type, e$]
[if my_tool_type = 5, my_probe_type = 2, my_probe_type, e$]
[if my_tool_type = 6, my_probe_type = 3, my_probe_type, e$]
       
[if my_probe_type = 3, my_edge_height = 0.05, my_edge_height, e$]
[if my_edge_height = 0, my_edge_height, e$]
       
my_tool_type = 0 #Reset tool type
my_probe_type = 0 #Reset probe type
my_edge_height = 0 #Reset edge height
my_tool_type_set = 0. #Reset tool type set

The first section is my way of taking the information pulled from this: (if prmcode$ = 20004, my_tool_type = rparsngl(sparameter$, 2) ) and convert it into the numbers used in the haas control. I know its messy but it kinda works..

Anyways, here's what my post looks like with 7 different tools being used.

( T1 | .250 X 2.125RCH SQ 3FL ALUMINUM C5 | H1 )
#5000_ = 4
#5200_ = .25
#5180_ = 6.0222
#5260_ = 3
#5220_ = .05
( T2 | .062 X .312RCH BALL 3FL | H2 )
#5000_ = 6
#5200_ = .062
#5180_ = 3.391
( T3 | .040 X .400RCH BALL 3FL | H3 )
#5200_ = .04
( T4 | .250 90DEG SPOT DRILL | H4 )
#5000_ = 5
#5000_ = 2
#5200_ = .25
#5180_ = 3.1517
#5260_ = 2
#5220_ = 0.
( T5 | 1.6MM DRILL | H5 )
#5000_ = 1
#5200_ = .063
#5180_ = 2.6875
( T6 | M2 X 0.4 TAP | H6 )
#5000_ = 2
#5200_ = .0787
#5180_ = 2.75
( T7 | .031 X .156RCH SQ 3FL | H7 )
#5000_ = 4
#5200_ = .031
#5180_ = 3.141
#5260_ = 3
#5220_ = .05
M0

T1 and T7 post perfect, but the other ones all have problems. This is where I'm stuck.  I'm new to this whole post editing thing, so any knowledge and help you can give would be amazing.

Link to comment
Share on other sites

No I don't have any formal training. Everything I've been doing up to this point is self taught. I'm not sure what MP documentation your referring too, so I'm going to say no I don't have it..

I will attach the documentation I've been using to accomplish this.

I didn't contact my re-seller because I don't believe this is a issue with mastercam, but my code in the post.

ToolOffset.Probing.pdf

ToolOffset.Macro.Vars.pdf

McamX4_NCI_Parameter_Ref.pdf

Link to comment
Share on other sites

I contacted my re-seller and they are unable to help me. They don't do any support for post that aren't their own and the only thing they would do is make me a new post from scratch. My company isn't interested in purchasing a new post as ours works. 

They did sent me the MP documentation though, so now I have that to read and learn from.

Link to comment
Share on other sites
  • 1 month later...
On 8/15/2019 at 7:30 AM, rmarshall5 said:

T1 and T7 post perfect, but the other ones all have problems. This is where I'm stuck. 

Please try to use forced output mode, 

Example: [if my_tool_type = 1, my_tool_type = 5, my_tool_type_set = 1, *my_tool_type, e$]

 

On 8/15/2019 at 7:30 AM, rmarshall5 said:

The underscore is where I would have to manually change the underscore for the proper tool number.  For example, for tool one, the correct  macro variable for "tool type"  would be #50001.  Now having to change the underscore myself isn't my biggest concern, although if anyone has ideas on how they can be sequential per tool that would be really cool!  This will make more sense later when I show my post.

Add:  

       fmt "#100 = " 4 my_tool_number    # Or other macro variable number

Change:

       Example:  fmt "#[51800+#100] = " 2     my_total_holder #Custom note format
        

Add output:

       my_tool_number = t$, *my_tool_number, e$

 

Good Luck!

 

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