534,964 active members*
2,594 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > What is the difference between M30 and M02
Results 1 to 16 of 16
  1. #1
    Registered
    Join Date
    Feb 2006
    Posts
    1770

    What is the difference between M30 and M02

    On my 0i Mate TC both are apparently same, causing program end as well as RESET which clears all the local and common variables. I thought M02 will not clear the variables, but it does clear.
    Then what is the difference between M02 and M30?
    Is it MTB dependent?
    Thanks in advance for your kind help.

  2. #2
    Moderator tobyaxis's Avatar
    Join Date
    Jan 2006
    Posts
    4396
    I know little about macro variables but M2 is a Program End where M30 is Program End and Rewind back to the beginning of the program.
    Toby D.
    "Imagination and Memory are but one thing, but for divers considerations have divers names"
    Schwarzwald

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

    www.refractotech.com

  3. #3
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    I also heard the same. But on my machine M02 also causes rewind. I am not able to figure out any difference between M02 and M30.

  4. #4
    Gold Member
    Join Date
    Jun 2008
    Posts
    1511
    What kind of control are you using? There might be a parameter setting that will not allow rewind of the program when using M2. This could also be built into the ladder by the MTB that it sees the rewind when executing a M2.

    I am not 100% but I have never come across a Fanuc control that did not clear the local variables (#1-#33) when program end or reset was used. Now if your common variables (#100-#199) there should be a setting for so they do not clear at program end or reset, they will however clear to null at power down. Variables #500-#999 should never clear until they are programmed to clear or you change them via MDI.

    Stevo

  5. #5
    Gold Member
    Join Date
    Mar 2003
    Posts
    2931
    You might want to check #3404 bit 5. On the 0iTC, this parameter controls whether M02 searches for the head of the program.

  6. #6
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    I referred to the parameter manual of 0i C.
    As per the given information (and as I have interpreted it), M30 and M02 can be made to behave differently or in the same manner. The difference is of REWIND.
    Parameter 3404#4 = 1 rewinds after M30.
    Parameter 3404#5 = 1 rewinds after M02.
    So, both cause system reset, but rewind depends on the respective parameter settings.

    Incidently, if you set 6001#7 = 1, local variables are not cleared by reset.
    Similarly, if you set 6001#6 = 1, common variables are not cleared by reset.

    This, however, may not be considered a safe programming practice, because everybody believes that local and common variables start with null values. This also means that a variable should preferably be made null, before using it. Otherwise, be prepared for surprises, at least occasionally.

  7. #7
    Gold Member
    Join Date
    Jun 2008
    Posts
    1511
    I have not worked on an Oi control before so this is the first that I have seen a parameter setting to allow or disallow the clearing of the local variables. I have seen the option for the common variables but only for power down not for program end or reset button. There is no setting for the permanent common variables (unless on newer controls). I have never assumed that local variables #100-#199 are cleared to null when starting. I only believed this if a power cycle was preformed.

    I agree that I would not want to leave data in the local variables. I would not care either way if the common variables #100-#199 cleared at program end. I use my locals for things like number or holes or bolt circles etc. Then use the common for calculations and cutting parameters. Onto the permanent common variables for clearance planes, crash protection, tool data etc. So the commons don’t make much difference to me.

    I am curious as to why there would be a parameter setting to allow M2 to act like M30. If you wanted the program to rewind then use M30 if not use M2. Does anyone have a scenario where you would want this setting? Is this something so postprocessors don’t need to be changed?

    Good info to know.

    Stevo

  8. #8
    Registered
    Join Date
    Aug 2006
    Posts
    98
    Some MTB use M30 to "Auto POWER OFF". And they work with to M30 or M02 in ladder program to RESET (G8.6 and G8.7). Some MTB´s use the same to reset the program. (variables and rewind)

    Daniel

  9. #9
    Registered
    Join Date
    Sep 2005
    Posts
    767
    The difference between M30 and M02 dates back to the old days of paper tape readers. M02 is a "Program end" and that output signal is usually wired to the remote reset input signal (ERS). An M02 reset is just going to stop the program. The M30 output was tied to the "reset-rewind" input signal (RRW) which not only resets the CNC, but also sends a "rewind" command to the paper tape reader. The tape reader is supposed to wind the tape backwards until it gets to the "rewind stop" or percent sign, and while the tape is rewinding, the control is inhibited from cycle starting again. On the older controls with tape readers that have reels, you will see that the tape reader will run in reverse after an M30 only if you are in TAPE mode. In MEMORY mode, the tape reader does nothing at all, but the memory resets to the begining. On the old controls with tape readers, we used to make two kinds of tapes. Very long tapes went on the reels, and ended in an M30. Shorter tapes we just spliced into a loop-tape. Those tapes ended with an M02 so that the tape reader would not try to rewind. We used loop tapes when possible because we could cycle start almost immediately after the program finished instead of waiting for the tape to rewinds.

    Since tape readers are passe nowadays, there is no practical difference between the ERS (reset) input and the RRW (Reset-rewind) input. They both stop the control, reset any variables, and set the program back to the beginning. There are parameters that determine whether or not many of the modal G-codes are set back to their power-up (Clear) states when a Reset is performed.

    I'm starting to feel like a CNC historian.

  10. #10
    Moderator tobyaxis's Avatar
    Join Date
    Jan 2006
    Posts
    4396
    Quote Originally Posted by Dan Fritz View Post
    I'm starting to feel like a CNC historian.
    I never used the Tape Readers but your detailed info clears up a lot of old questions. Very Informative.

    Thanks Dan
    Toby D.
    "Imagination and Memory are but one thing, but for divers considerations have divers names"
    Schwarzwald

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

    www.refractotech.com

  11. #11
    Gold Member
    Join Date
    Jul 2005
    Posts
    12177
    Quote Originally Posted by Dan Fritz View Post
    ..... On the old controls with tape readers, we used to make two kinds of tapes. Very long tapes went on the reels, and ended in an M30. Shorter tapes we just spliced into a loop-tape. Those tapes ended with an M02 so that the tape reader would not try to rewind...

    ....I'm starting to feel like a CNC historian.
    I find it fascinating how the archaic terminology is still active; M30 program stop and rewind.

    You make a good CNC historian and I find it very interesting. I almost got involved in CNC in 1979 but the company I was working for went bankrupt. My next exposure to CNC was in 1999 and there were lot of changes; your 'history' gives interesting background.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  12. #12
    Moderator tobyaxis's Avatar
    Join Date
    Jan 2006
    Posts
    4396
    Quote Originally Posted by Geof View Post
    I find it fascinating how the archaic terminology is still active; M30 program stop and rewind.

    You make a good CNC historian and I find it very interesting. I almost got involved in CNC in 1979 but the company I was working for went bankrupt. My next exposure to CNC was in 1999 and there were lot of changes; your 'history' gives interesting background.
    The Historians of Machining, LOL.

    Geof, remember Machine Shops that were Overhead Belt Driven by Steam Engines???
    Toby D.
    "Imagination and Memory are but one thing, but for divers considerations have divers names"
    Schwarzwald

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

    www.refractotech.com

  13. #13
    Gold Member
    Join Date
    Jul 2005
    Posts
    12177
    Quote Originally Posted by tobyaxis View Post
    ....Geof, remember Machine Shops that were Overhead Belt Driven by Steam Engines???
    Come on, I am not quite that old.

    Although I will admit the place I served my apprenticeship in New Zealand still had one machine driven from a lineshaft with fast and loose pulleys. The guy using it was in his late seventies and he would not change; the line shaft was driven by an electric motor.

    There were also a couple of machines dating back into the late eighteen hundreds but these had been converted to direct drive with electric motors.


    I think we are guilty of hijacking someone's thread but what the heck.


    The neatest thing is that I went to New Zealand in 1979 and visited the company where I served my apprenticeship. they had moved but the machine that I started on my first day of work in January 1960 was still in use. And a setup I had devised as an apprentice was still being used for making a firefighting nozzle.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  14. #14
    Moderator tobyaxis's Avatar
    Join Date
    Jan 2006
    Posts
    4396
    Quote Originally Posted by Geof View Post
    Come on, I am not quite that old.
    I think we are guilty of hijacking someone's thread but what the heck.
    Now we are in trouble. Thread Hijacking is pretty bad, but as you already said, "What the Heck"

    To see where things started and to see the way it is now is pretty amazing.

    Now do you remember those old DOS 300MHz PC's???? Look where they are now.

    Geof, do you ever get the feeling that maybe technology is moving too fast??
    Toby D.
    "Imagination and Memory are but one thing, but for divers considerations have divers names"
    Schwarzwald

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

    www.refractotech.com

  15. #15
    Registered
    Join Date
    May 2013
    Posts
    0
    Enjoyed the historical explanation of the tape rewind differences. My question is: if you are in the middle of a CNC program and you have to abort it, for whatever reason (say you crashed and have to scrap the part), what is the normal process for doing this? My company is just now entering the Machine Tool Monitoring market with a product called MT Focus (www,mtfocus.com). We provide a real-time, web browser-based view of what's happening on one's shop floor (OEE, Spindle Utilization, Cycle Time/Machine Down E-mail Alerts, etc.). We are trying to figure out how we can get an output from the machine that tells us that the executing program has been aborted (allowing us to properly deal with the data associated with that aborted cycle). We had hoped that M02/M30 would differentiate between a normal cycle completion and an aborted cycle, but that does appear to be the case. Any input you can offer would be appreciated.

  16. #16
    Registered
    Join Date
    Jul 2013
    Posts
    10

    Re: What is the difference between M30 and M02

    Quote Originally Posted by tobyaxis View Post
    The Historians of Machining, LOL.

    Geof, remember Machine Shops that were Overhead Belt Driven by Steam Engines???
    Remember when they were driven by water.... from the stream outside your factory?

Similar Threads

  1. difference between a 6m and 6m b
    By beekeeper in forum Fanuc
    Replies: 4
    Last Post: 08-03-2010, 11:50 PM
  2. VSD-E and VSD-XE difference
    By LBodnar in forum Granite Devices
    Replies: 6
    Last Post: 02-28-2010, 09:27 PM
  3. Difference between 320 and 340?
    By amasters in forum Gecko Drives
    Replies: 5
    Last Post: 05-24-2006, 11:46 PM
  4. What's the difference?
    By ignatz in forum Stepper Motors / Drives
    Replies: 4
    Last Post: 03-08-2006, 05:39 AM
  5. What is the difference?
    By Hack in forum General CNC (Mill / Lathe) Control Software (NC)
    Replies: 5
    Last Post: 10-09-2005, 03:46 PM

Tags for this Thread

Posting Permissions

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