587,311 active members*
3,561 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Mazak, Mitsubishi, Mazatrol > How to implement O9000 ATC macro in Yasnac MX3 ona VTC41 1991
Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2012
    Posts
    19

    How to implement O9000 ATC macro in Yasnac MX3 ona VTC41 1991

    Dear members,

    First off, I apologize for this long post.
    If someone sees the challenge in this, they will read this all the way and try to make sense of it.

    I am either seeking help in making my own written macro work, or explain details on or how to implement Mazak's one into my Yasnac MX3 controller.

    Here is the whole story:
    I have been successful in bringing a half dead Mazak VTC-41 back to life.
    Unfortunately I didn't expect a basic machine function like an automatic tool change not to be part of the ladder program, and so it happened that I never made the O9000 programs visible and backed them up before regenerating the system.

    Regenerating the system was necessary due to data corruption giving me constant random errors.

    I did receive several ATC macros for this machine which it looks like had ATC 430-1 A installed originally (says it on old floppy drive). I did receive ATC 430-3 from Mazak the other day, but have questions regarding implementing it.

    The macro is an O9000 program which would be called up by a T-command and processed as a macro if I set Pm #6134 to 1. At the same time, the value of my T command would become the argument of common variable #149, which it does, but........

    well to shorten this long story, I wrote this the other day... in conjunction with an empty O9000 to get the T value put into variable 149.
    It does everything but turn the carousel at all.

    %
    O9001 (I CAN CALL THIS MACRO WITH AN M06 COMMAND BY PUTTING A 6 INTO PARAMETER #6130)
    N0010 M05;
    N0020 G30 X0.0 Y0.0 Z0.0;
    N0030 M19;
    N0040 M16;
    N0050 M12;
    N0060 M11;
    N0070 G0 Z4.8;
    N0080 T#0149 M6;
    N0130 G30 Z0;
    N0150 M10;
    N0170 M13;
    N0190 M15;
    N0210 M99;
    %

    The one from Mazak has conditional expressions and looks like this:

    Let me one of my biggest questions right at the top before you read the whole macro.
    My biggest question is:
    If the macro starts a so called repeat command "DO" which states in the manual like this:
    While <conditional expression> is satisfied, the blocks between DO m and END m are repeated.
    When it is unsatisfied, the process branches to the block next (below) to END m. (m=1, 2, 3)
    why am I seeing every single repeat command in the following macro with nothing in between DO and END?

    And also, in line N10, why is the call up of the program number in there?

    HOW DO I IMPLEMENT THIS MACRO PROPERLY INTO A YASNAC MX3. (SORRY FOR YELLING;-)

    I put an explanation of the variables and decimal values according to my manual next to some lines.
    %
    O9000 (O9000 can be called up as a macro by a T command)

    (AUTO TOOL CHANGE 430-3)

    #1=#4003
    #2=#4007
    #3=#4001 (#4001-40021 gives modal G code information from group 01-21)

    WHILE[#1000EQ1]DO1 (#1000 IS A SYSTEM VARIABLE: INTERFACE INPUT SIGNAL; 1 is a collectively read decimal value of 16 point (bit) input signal)
    END1
    IF[#4014EQ67]GOTO10 (#4014 IS A SYSTEM VARIABLE: MODAL INFORMATION OF SEQUENCE NUMBER)
    G67
    N10 IF[#4015EQ50]GOTO20 (#4015 IS A SYSTEM VARIABLE: MODAL INFORMATION OF PROGRAM NUMBER)
    G50
    N20 G00G40G80G69
    G91G30XY0Z0T#4120 (#4120 IS A SYSTEM VARIABLE: MODAL INFORMATION FOF T CODE)
    IF[#1001EQ0]GOTO4
    IF[#1004EQ1]GOTO2
    IF[#1003EQ1]GOTO3
    WHILE[#1005EQ0]DO1
    END1
    G91G28Z0
    WHILE[#1006EQ0]DO1
    END1
    G91G30Z0
    GOTO4
    N2
    G91G28Z0
    WHILE[#1007EQ0]DO1
    END1
    G91G30Z0
    GOTO4
    N3
    WHILE[#1005EQ0]DO1
    END1
    G91G28Z0
    N4
    WHILE[#1001EQ1]DO1
    END1
    G#1G#2G#3
    M99
    %

    #1000 through 1015 and 1032 are interface input signals variables.


    Any help is greatly appreciated, I hope that there are some people out there that are macro gurus.

    Sincerely
    Oliver Hanisch

  2. #2
    Join Date
    Dec 2012
    Posts
    19

    I seem to be alone with this old dog...

    Wow, not a single answer....

  3. #3
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by oliverhanisch View Post
    Wow, not a single answer....
    Set parameter 6134 to 1. This will have the T code handled as a Macro Call command to call program O9000. The Tool Number specified with the "T" code will be stored in Common Variable #149 for use in the O9000 Macro program.

    Quote Originally Posted by oliverhanisch View Post
    why am I seeing every single repeat command in the following macro with nothing in between DO and END
    Because these Conditional Statements are being used to pause the program until an Interface Input is made. The Inputs will be from proximity switches located for the G28 and G30 Z positions. I'm assuming that the Z axis will move Up and Down to clear and capture the tools during the Tool Change sequence. I'm also assuming that there will be a Timer in the PLC to raise and alarm if these switches are not made. The Conditional Statements as are, will result in an endless loop if these Inputs retain a "0" logic state.


    Regards,

    Bill

  4. #4
    Join Date
    Dec 2012
    Posts
    19
    Oh hi Bill, I didn't see that you also replied on CNC zone.

    I am still tied up, but will let you know asap what my results are when trying putting the macro in.

    Sincerely

    Oliver Hanisch

  5. #5
    Join Date
    Dec 2012
    Posts
    19
    Dear Bill,

    I hope that you still get alerted when a new post gets into this threat.
    I finally got to put the macro into my VTC41.

    I put it in as O9000 and let it called up with a T command having set 6134 to 1.

    All other parameters from 6120 through 6129 for O90010-O9019 and 6130 through 6133 and 6580 through 6599 that are allocated for macros O9001 through O9009 and then O90020-O9034 I left turned off.

    The macro moves my spindle into home 2 position and that's it.

    I don't even see how the macro could give commands to open the tool changer door (M14 or 15) advance the tool changer carousel (M12 or 13) and then change the tool.

    I also don't see the macro calling up a subprogram to do all of these actions.

    Well, maybe I am very close to solving this... if you get this and you might want to point something out that I might forget right now, please let me know.

    Oh, and the common vatiable #149 is changing to the T value by the way.

    Oh, if you don't mind, can you send me your phone number via private message, a simple phone call might clear everything up.

    And by the way, the 370 spindle over heat error is still persistent on my H400N. I got pretty far with every other problem that I still had, but no one knows anything about the spindle over heat error.
    I already replace the thermistor and checked a spindle thermostat to no avail.



    Thanks

    Sincerely
    Oliver Hanisch

  6. #6
    Join Date
    Dec 2012
    Posts
    19
    This is what I replied to Todd on the the practical machinist forum:

    I put the macro in just like you suggested to do it. I remembered that I had already done it before, so I actual just checked everything and tried running it, but the macro only moves my spindle into home 2 position and then stops.
    It then jumps all the way to the end (N4) and does nothing.

    There is something missing in general. The system input and output variables can drive solenoids I know that, but when it comes to the first block of conditional expressions, it jumps directly to N4 which is the end of the macro.

    I had the Mazak tech take a look at it and he could not figure it out either.

    I was hoping that Bill would be back on this with me, but I let him hang when I had to repair the H400N.
    I hope that he is going to pick up on this thread again.

    Thanks for your attempt to help though Todd.

    Sincerely
    Oliver Hanisch

  7. #7
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by oliverhanisch View Post
    This is what I replied to Todd on the the practical machinist forum:

    I put the macro in just like you suggested to do it. I remembered that I had already done it before, so I actual just checked everything and tried running it, but the macro only moves my spindle into home 2 position and then stops.
    It then jumps all the way to the end (N4) and does nothing.

    There is something missing in general. The system input and output variables can drive solenoids I know that, but when it comes to the first block of conditional expressions, it jumps directly to N4 which is the end of the macro.

    I had the Mazak tech take a look at it and he could not figure it out either.

    I was hoping that Bill would be back on this with me, but I let him hang when I had to repair the H400N.
    I hope that he is going to pick up on this thread again.

    Thanks for your attempt to help though Todd.

    Sincerely
    Oliver Hanisch
    Hi Oliver,
    If the program falls through to N4 when it executes IF[#1001EQ0]GOTO4, you will have to find out what is connected to that interface point and determine why its in a logic "0" state. It could well be that its being set by the PLC after G91G30XY0Z0T#4120 is executed (a "T" code in a Macro program called by a G,M, or T code is treated as an ordinary "T" code and is processed by the PLC) and if the spindle tool = #4120, the program drops though without a tool change, but this is only a guess.

    The other thing that's notable, is that there is no M6 in the Macro program. Logically, there should be some method of being able to call a Tool to the ready position without actually making a Tool Change. As the program stand, and if it were working properly, it would seem that a Tool Change would result when only a "T" code is executed from the calling program. It could also be that it relies on the M6 being treated as an ordinary "M" code in the calling program. In this case, you should ensure that the numeral "6" is not set in any parameter to create a Macro call via "M" code

    The comments in brackets in the following block don't make sense The first block is checking if #4014 is 67, and if not, it's set to that value. #4014 is a group 14 G code, not a Sequence number. G67 is the Cancel Code for a Modal call of a Macro Program. #4015 refers to G50 and G51, scaling off and on respectively, not a Program Number.

    IF[#4014EQ67]GOTO10 (#4014 IS A SYSTEM VARIABLE: MODAL INFORMATION OF SEQUENCE NUMBER)
    G67
    N10 IF[#4015EQ50]GOTO20 (#4015 IS A SYSTEM VARIABLE: MODAL INFORMATION OF PROGRAM NUMBER)


    You need to check your Macro program thoroughly, to ensure there are no mistakes before going much further.

    Regards,

    Bill

  8. #8
    Join Date
    Dec 2012
    Posts
    19
    Hi Bill,

    thanks for picking up this thread again.

    the identification of the particular items I extracted from the manual I have, but I am glad if it's not accurate, because it might bring me (us) a step further

    I verified that #0149 has the actual T code value after I tried to call up the macro. I will have to check #4120 but I don't think I can see it. I might have to do what you described it:

    To check if a value is being recorded in #4120, add the following code to the start of your Tool Change program.

    #1 = #4120
    M00

    Concerning the 6 in one of the parameters I made sure that all of the pertaining parameters to either G or M codes are left alone. This is what I had checked earlier:

    Parameters from 6120 through 6129 for O90010-O9019 and 6130 through 6133 and 6580 through 6599 that are allocated for macros O9001 through O9009 and then O90020-O9034 I left at "0"

    I will check the macro precisely again to see that I have put in everything correctly. I did double check already, but will do it again and compare it with the two different versions I by now have of the macro.

    By the way, I do have a floppy disk with the macro on it for this machine, but until I had to deal with the parameters on my H400N, I had no idea that Mazak has a proprietary file system format and that these floppies cannot be verified with DOS or Windows.
    So... there is a good chance that my floppy isn't corrupted and I just have to find a way to connect a floppy drive to my RS232 in/output.

    To my knowledge that is not that easy, since the Mazaks are designed to work with a CMT (cassette magnetic tape) devise and not with a PC.

    I'll get back with you Monday.

    Thanks again for trying to figure this out with me.

    Ollie

  9. #9
    Join Date
    Dec 2012
    Posts
    19
    Problem solved.

    Bill and Todd,

    everything was implemented correctly but the version was wrong.
    I needed Tool Change Marcro 430-1A.
    I had 430-3

    Lesson learned, don't assume that an upgraded version would work, because that's what I have been doing.

    I really thought that the upgrade would still work in its basic function, but besides, until today, I had no source for the original macro anyway.

    I got if from Mazak today.

    Just in case if anybody hits the same problem one day with a Yasnac MX3 and a VTC41 machine, here is the macro.

    %
    O9000
    (AUTO TOOL CHANGE 430-1A)
    N1#1132=0.0
    WHILE[#1000EQ1]DO1
    END1
    #1=#4120
    #3=#4003
    #4=#4007
    G40G91T#1
    #1106=1.0
    G30X0Y0Z0M19
    N2#1101=1.0
    #1102=1.0
    WHILE[#1002EQ0]DO1
    END1
    IF[#1003EQ1]GOTO6
    WHILE[#1001EQ0]DO1
    END1
    IF[#1004EQ1]GOTO4
    WHILE[#1005EQ0]DO1
    END1
    IF[#1EQ0]GOTO5
    N3#1106=1.0
    WHILE[#1006EQ0]DO1
    END1
    #1108=1.0
    WHILE[#1008EQ0]DO1
    END1
    #1109=1.0
    WHILE[#1009EQ0]DO1
    END1
    G28Z0.
    #1111=1.0
    WHILE[#1011EQ0]DO1
    END1
    G30Z0.
    #1109=0.0
    #1113=1.0
    WHILE[#1013EQ0]DO1
    END1
    #1108=0.0
    #1114=1.0
    WHILE[#1014EQ0]DO1
    END1
    GOTO6
    N4G28Z0.
    #1111=1.0
    #1109=1.0
    #1106=1.0
    WHILE[#1009EQ0]DO1
    END1
    WHILE[#1006EQ0]DO1
    END1
    #1108=1.0
    WHILE[#1008EQ0]DO1
    END1
    WHILE[#1011EQ0]DO1
    END1
    G30Z0.
    #1109=0.0
    #1113=1.0
    WHILE[#1013EQ0]DO1
    END1
    #1108=0.0
    #1114=1.0
    WHILE[#1014EQ0]DO1
    END1
    GOTO6
    N5#1106=1.0
    WHILE[#1006EQ0]DO1
    END1
    #1108=1.0
    WHILE[#1008EQ0]DO1
    END1
    #1109=1.0
    WHILE[#1009EQ0]DO1
    END1
    G28Z0.
    #1108=0.0
    #1109=0.0
    #1113=1.0
    #1114=1.0
    WHILE[#1014EQ0]DO1
    END1
    N6#1132=0.0
    #1107=1.0
    G#3G#4
    M99
    %=


    Thank you Bill for your time and efforts.


    Sincerely

    Oliver Hanisch

  10. #10
    Join Date
    Sep 2010
    Posts
    1230
    Hi Oliver,
    Just out of interest, is M06 specified in the Calling program, as in T?? M06, or do you just have T??

    Regards,

    Bill

  11. #11
    Join Date
    Dec 2012
    Posts
    19
    Quote Originally Posted by angelw View Post
    Hi Oliver,
    Just out of interest, is M06 specified in the Calling program, as in T?? M06, or do you just have T??

    Regards,

    Bill
    Hi Bill,

    no M06 required at all. That's what you mean right?
    All I have to do is put in the tool number with T... and it changes it.
    The only thing it doesn't do is closing the tool changer door. I have to though an M15 after all of it.

    But I am going to study the macro and see what drives that solenoid for the door in the first place and see why it doesn't close it after the change is done.

    By the way, I today I learned how to use the machine variable I/O sheets in the manual. It is still horrifically cumbersome to find the source for I/Os with this, but at least there is a chance.

    Sorry to jump on you again now, do you have any knowledge about rigid tapping on the MX3?

    I lost all macros and my boss now wants me to find that macro and implement it.


    Thanks for your help... and I just now realized that you are in Australia.

    Greetings to the world on the other hemisphere :cheers:

    Ollie

Similar Threads

  1. O9000 Tool Change Macro
    By omkargupta in forum Fanuc
    Replies: 2
    Last Post: 09-17-2013, 01:00 PM
  2. EDIT O9000 tool change macro fanuc 0M
    By mikul in forum Fanuc
    Replies: 3
    Last Post: 11-27-2012, 08:48 PM
  3. custom macro in yasnac?
    By lpgoldtop in forum Parametric Programing
    Replies: 8
    Last Post: 04-11-2012, 07:32 PM
  4. Macro program tool change O9000
    By baow in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 08-13-2009, 10:58 AM
  5. O9000 Tool Change Macro
    By omkargupta in forum Fanuc
    Replies: 1
    Last Post: 09-10-2007, 10:41 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
  •