585,763 active members*
4,069 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > Fanuc OM - M99 Clears Common Variables
Results 1 to 13 of 13
  1. #1
    Join Date
    Jul 2003
    Posts
    69

    Fanuc OM - M99 Clears Common Variables

    I am trying to run/call a couple of sub programs from a While-Do loop and when it exists the sub with M99 it clears all the values in the common variables registry #100-#199. I know M99 will clear the local variables but I didn't think it clears the common variables. Is there a parameter that needs to be changed to prevent this ?.

    i.e.

    #100=0
    WHILE[#100LT5]DO1

    M98 P1111

    M98 P2222
    #100=#100+1
    END1

    Thanks

  2. #2
    Join Date
    Mar 2003
    Posts
    2932
    You might check parameter 0040 bit 6. It clears the common variables on reset. Maybe M99 is behaving as a reset.

  3. #3
    Join Date
    Feb 2006
    Posts
    1792
    M99 does not clear common variables (otherwise these cannot be called common variables!). There is some other problem in your program. If the issue is not yet resolved, post the complete program.

    Parameter 6001#6 = 1 would retain common variables even after system reset.

  4. #4
    Join Date
    Jan 2005
    Posts
    304
    Did you set the parameter #6037 to the number of variables you need to be common? If you did not then they will reset at the end of the program and will be available in the "nest level" of sub program in which they are set.

  5. #5
    Join Date
    Jun 2008
    Posts
    1511
    Quote Originally Posted by sinha_nsit View Post
    M99 does not clear common variables (otherwise these cannot be called common variables!). There is some other problem in your program. If the issue is not yet resolved, post the complete program.
    Common variables can be cleared to null with the reset of the control. Most of the Fanucs have a parameter to set the local variables #1-#33 and common variables #100-#199 to the desired state. The only ones that I know cannot be adjusted are the permanent common variables #500-#999.

    On the Oseries control the parameter is 10.6 to allow clearing of the common variables at reset. See attachement.

    This of course does not explaine the resetting of these with the M99 code but I have seen stranger things.

    What is the condition of 10.6?

    Stevo
    Attached Files Attached Files

  6. #6
    Join Date
    Jul 2003
    Posts
    69
    Thanks guys for the replies.

    Parameter 0040 bit 6 is all zeros. (00000000).
    Parameter 6001#6, there are no 6000 series parameters in this control.
    stevo1 parameter 10.6 is that parameter 0010 bit 6 ?, if so it's zero (10000000).

  7. #7
    Join Date
    Jun 2008
    Posts
    1511
    Quote Originally Posted by ED209 View Post
    Thanks guys for the replies.

    Parameter 0040 bit 6 is all zeros. (00000000).
    Parameter 6001#6, there are no 6000 series parameters in this control.
    stevo1 parameter 10.6 is that parameter 0010 bit 6 ?, if so it's zero (10000000).
    I apologize I don't know where my head was at when I was posting . I meant 40.6 as Dcoupar had stated. I was helping someone else in another thread regarding workshift which uses parameter 10.6 and I just got them backwards.

    Anyway yes I would try as Dcoupar had suggested change 40.6 to 1 and see if you have the same problem.

    Yes when stating 10.6 or 40.6 this means parameter 10 bit 6. Bits run right to left (76543210).

    Stevo

  8. #8
    Join Date
    Jul 2003
    Posts
    69
    Thanks guys I'll give that a try. I was looking in the parameter book & parameter 40.7 is for local variables #1 - #33, 1 "Does not place local variables in vacant state during reset". I was wondering if I should or should not change this one also ?.

  9. #9
    Join Date
    Jun 2008
    Posts
    1511
    It is really depends on your preference. I have my #1-#33 clear to null if reset is hit or program end. I like them this way because I write a lot of nested macros and it can be hard to keep track of what they are and this can cause a problem later in the program. These I usually use as counters and part dimensions etc.

    If I need variables to keep say for special functions like auto offset or tool CL at head rotation I use #100-#199 as these will stay but I can use them across most of my smaller single program macros because I set the value in the program so it won't matter what they were set to.

    Then you have the permanent variables #500-#999. These I use for probe data, tool tracking, any kind of special counts that I don’t want to lose at power down.

    By having these setup this way you get all 3 scenarios of variable usage that can be applied as you write the macros.

    Stevo

  10. #10
    Join Date
    Jul 2003
    Posts
    69
    Ok that makes total sense. I will follow the same as some of our other m/c controls are like that. Also when the program returns from the sub program (M99) it was like it is in a single block state. I found in the parameter book, 11.5 (SBKM) 1: Machine is stopped in single block skip by macro command. 0: Machine is not stopped in single block skip by macro command. (Usually set to "0"), currently set to all "0"s. Could this be what needs to be changed ?.

  11. #11
    Join Date
    Jun 2008
    Posts
    1511
    I don't use it but this is typically for proving out macro programs. Most of the time the macro programs do not single block. This is to allow single block in a macro call.

    This is not your problem.

    Have you tried 40.6 yet?

    Stevo

  12. #12
    Join Date
    Jul 2003
    Posts
    69
    No not yet. Won't get a chance until tomorrow. I'll let you know then. Thanks.

  13. #13
    Join Date
    Jul 2003
    Posts
    69
    Thank you gents, param 40.6 worked like a charm. Best to you & have a great weekend.

    Ed

Similar Threads

  1. Common Line Cutting - We are the best. And, you don't have it.
    By Optimation in forum News Announcements
    Replies: 1
    Last Post: 09-05-2008, 08:13 AM
  2. Common Variables
    By viorel26 in forum G-Code Programing
    Replies: 3
    Last Post: 10-02-2007, 10:09 PM
  3. Need help with IF ,THEN,AND GOTO USING COMMON VARIABLES.
    By XRACERJB in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 2
    Last Post: 08-31-2007, 02:08 PM
  4. Seicos MYII control (Fanuc type) variables
    By pieface in forum Uncategorised MetalWorking Machines
    Replies: 3
    Last Post: 02-21-2006, 07:50 PM
  5. Common?to Most Surfers
    By Bear in forum Fadal
    Replies: 1
    Last Post: 01-22-2006, 09:13 AM

Posting Permissions

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