586,069 active members*
3,596 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2006
    Posts
    247

    macro variable for mazatrol tool length

    I'm using the following code to assign the tool length of the tool currently in the spindle to variable #501:

    #500=#51999(-----------------------------CURRENT TOOL #)
    #501=#[60000+#500](----------------------CURRENT TOOL LENGTH)

    anybody know why this code would not work as expected?

    I check the macro variable page after executing the code with T12 in the spindle, but the value in #501 is the length of T15 from the mazatrol tool data page.

  2. #2
    Join Date
    Jun 2006
    Posts
    247
    when I check variable #500, it has a value of 12, which it should have, which makes this even weirder.

    And even if I change the line to:

    #501=#[60000 + 12] or
    #501=#60012

    the value found in #501 is still the length of T15
    weirder still...

  3. #3
    Join Date
    Jun 2006
    Posts
    247
    I loaded my macro onto the adjacent machine and it ran perfectly
    (they're both VCN mills w/ matrix control)

    the 2nd machine is newer than the first, and I'm guessing there's some parameter issue at hand here, even though the older machine seems to do erratic things with this code.

    when I proved out the macro on the newer machine today, I switched the tool position around as well as altered the length, and it worked right every time.

    The only parameter I've found so far that I thought could affect this behavior is F92, and its set the same on both machines.

  4. #4
    Join Date
    Mar 2005
    Posts
    988
    How many tool datas are you running for T12? Also, are you using any modifiers? (A, B, C, etc) Just fishing around here.....


    Also, if you're checking the macro statement through MDI function, make sure you hit the RESET button after you execute the button and before you check the variable page..... Matrix doesn't update in MDI immediately from a viewing standpoint
    It's just a part..... cutter still goes round and round....

  5. #5
    Join Date
    Jun 2006
    Posts
    247
    how many tool datas?
    please help me understand what you mean by that...

    In the meantime, I did figure out how to get the correct tool length for the tool currently in the spindle. Apparently it has to do with the "tool data" you're referring to.

    The correct code is as follows:

    #500=#3020(----------------------CURRENT TOOL DATA LINE #)
    #501=#[60000+#500](-------------CURRENT TOOL LENGTH)

    where #3020 is the "sequence number of the tool data line for the tool currently in the spindle" (this is what the manual calls it)

    It doesn't make any sense to me, but tool #1 might have a "data line" number of 22, and tool # 2 might have a "data line" number of 7. (tool #5 on the adjacent machine happened to have a matching data line #, as did several other tools)

    I don't know the purpose of this so-called "data line #", or how to check what the value is for each tool, unless I call up each tool one at a time and assign #3020 to one of the common variables to check on the variable page.

  6. #6
    Join Date
    Mar 2005
    Posts
    988
    Basically, you have the right idea.

    "How many Tool Datas" is because of the sequence number... . I didn't think the VCN was tracking like this but I guess any machine using Tool Data would possibly run into this issue.

    The sequence number is a number that Mazatrol assigns to track different tools. For the most part, it matches your "Tool number" but as you've found, it may not. This sequence number is generated somewhat randomly.

    So, why does it create a sequence number? Because with Mazatrol tool data, you can describe the same tool dozens of ways. When doing this, you simply change the alpha-numeric number of the Tool. For example: I might call a 1/2 endmill tool number 5A and tool number 5C for some reason. Then, 5A and 5C might have different length offsets or even different diameter info for some reason. So in this situation, you can't use #51999 because that variable only sees a number 5. It can't distinguish between the letters A and C. However, #3020 can by reading "tool sequence number" or the number assigned in the background by Mazatrol.

    There is a way to 'reset' your sequence numbers .... so to speak. You can copy the Tool Data text file and save it. Then dump all of your Tool data from the control and reload the text file. It should sequence everything as you have them numbered.

    HOWEVER!!!!! If your machines are ran stand alone and may go through many different tools and changes in the magazine..... Don't bother doing this. Odds are, the sequence numbers will get flopped around again.

    My advice is just keep using #3020.... it works for what you need. Just keep in mind though, if you write a macro that actually needs to reference the Tool number as the program reads or the position page shows.... then you'll need to use #51999 for that (because #3020 might not be what you expect anymore).


    NOTE: I've actually complained about this before with the sequence numbers it chooses. I don't mind that it's doing this but the numbers should somewhere higher and not within a generally used tool number range. Better yet, if #3020 or #51999 could actually read it as a decimal range would be better (like it's done with tool calls in a g-code program).
    It's just a part..... cutter still goes round and round....

  7. #7
    Join Date
    Jun 2006
    Posts
    247
    Thanks a lot for the explanation, I appreciate your help and advice.

    I never realized the same physical tool could be called 5A and 5B at the same time. I can think of a lot of ways this would be useful though. I'd like to know how to go about setting it that way. Is it as simple as assigning the same pocket # to the different tool datas?

  8. #8
    Join Date
    Mar 2005
    Posts
    988
    Yes..... I guess. I say that because I didn't realize a VCN would be able to do this. Must be a Matrix thing. In the past, this was something done on Lathes. I only have Matrix controls on my Integrexes and eMachines. My mills are all Fusion which can only have one tool to one pocket.

    Interestingly though, you have variable #3020 available so I guess you can do this?
    So, assuming you're able to do this, it should be something like this:

    On Matrix, go to the Tool Data and cursor to the tool you want to create new data for. Press EDIT then you should see a button for TOOL ADD. Press this and then you'll see a duplicated pocket created with no data. Simply enter in similar data like your original tool except add a letter to the description (where it says ID CODE). If I create alpha tools, I have all tools in that pocket carry a letter.... no blanks. It's possible to create a number of "blank" tools but then you're just confusing the machine. Actually, the machine won't be confused because it will simply use the first tool it sees on a data scan at tool change..... you sure will be confused though when it crashes.

    Typical uses??? On my eMachines I may do this for things like saws/disc mills or maybe form tools that have bottom and top cutting forms.... especially custom grinds or indexables. Doing this, you can set a tool offset for the bottom cut side and another offset for the top cut side. Excellant tool control doing this for blends and such and you can take out any guess work for varying inserts widths or grind widths or even regrinds if you do that. This is no different than the old school method of multiple H values on the Offset page for similar situations.

    If you're using Mazatrol, the tool description calls the tool so you should be reasonably safe here. With EIA programs, you need to pay a little more attention. Even with alpha tools, you can still call by the pocket (tool) number like normal. When you this, the control will simply default to the offset it first sees. This is not necessarily the letter A for example. You could have data that shows in this order: C, A, E. If these are letters for T20, when you call T20M6, the machine will load the offset for "C" because it's the first offset it finds on the Data page. This can be a surprise if you're expecting "A".

    So, the format for the tool calls is simply this (using pocket 20):
    T20.01 (for A)
    T20.02 (for B), etc ,etc.

    For tools called HEAVY, you add 60 to this like so:
    T20.61 (for Heavy A)
    T20.62 (for Heavy B), etc ,etc.

    Simply call the "new tools" while you're in the machining area by using the M6 command (this updates the control for the new offset or obviously change tools if needed).
    Now I always recall the work offset and G43 (if you use this) again so I'm not sure if the machine tracks this live. In Mazatrol programs, this should not be an issue.


    Sorry for the lengthy post.... I'm not sure if your machine can do all this but I am curious.... let me know.
    It's just a part..... cutter still goes round and round....

  9. #9
    Join Date
    Jun 2006
    Posts
    247
    hey, Im glad for you're lengthy post, I'm trying to learn here...

    What I learned this morning so far is it looks like I cant assign tools this way. When I press the edit button for the selected tool, theres no "Tool add" I can find anywhere.

    Also, when I try to assign the same pocket # to two different tools, it tells me its illegal to do so.

  10. #10
    Join Date
    Mar 2005
    Posts
    988
    OK..... it's just strange that your mill is using #3020 and assigning sequence numbers.

    I would talk to someone in Mazak applications. There may be a parameter like an R bit or something that isn't set right for mills. If you can't add tools then there's no purpose for #3020 to be used... you should never have issues with #51999 for this arrangement.

    Even with alpha/numeric tools, it shouldn't matter because the Tool Data scan will only find one tool number in the pocket regardless of the added letter.

    I don't think anything "bad" will happen but it's worth the question..... especially since the way you program is being affected.
    It's just a part..... cutter still goes round and round....

Similar Threads

  1. makino automatic tool length presetter macro
    By PETE1968 in forum Uncategorised MetalWorking Machines
    Replies: 0
    Last Post: 12-08-2010, 09:30 PM
  2. Constant Power W/ Variable Wire Length
    By Arbiter in forum CNC Wire Foam Cutter Machines
    Replies: 10
    Last Post: 11-25-2010, 08:59 AM
  3. Mazatrol Tool Def length Default value
    By epelchat in forum Mazak, Mitsubishi, Mazatrol
    Replies: 4
    Last Post: 10-14-2010, 06:17 PM
  4. Macro Variable Lock
    By James L in forum Haas Mills
    Replies: 2
    Last Post: 07-23-2009, 02:29 PM
  5. Macro variable for current tool diam ?
    By Shizzlemah in forum Fadal
    Replies: 3
    Last Post: 10-30-2006, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •