587,210 active members*
3,381 visitors online*
Register for free
Login
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2012
    Posts
    182

    help with sub-program in macro-A

    I'm trying to pass variables from one macro to a sub macro to remove repetitive code and simplify programing. trouble is the sub-program is wiping the variables when it returns to the main program with M99.

    I only have variables #100 to #131 and variables #500 to #531. I'd like to have the 100 series variables stay resident in the sub-macro and when the sub-program ends avoiding the need to save essential variables in the #500-531 range

    I tried parameter (0m-a) 40#6 but it didn't seem to have an effect. my previous parameter 40 was 00000000 and changed to 01000000.

    found a problem with the macro that caused the issue. now works as I intended.
    solved the problem by inserting optional stops M00 to help debug.

  2. #2
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by landslide1 View Post
    I'm trying to pass variables from one macro to a sub macro to remove repetitive code and simplify programing. trouble is the sub-program is wiping the variables when it returns to the main program with M99.

    I only have variables #100 to #131 and variables #500 to #531. I'd like to have the 100 series variables stay resident in the sub-macro and when the sub-program ends avoiding the need to save essential variables in the #500-531 range

    I tried parameter (0m-a) 40#6 but it didn't seem to have an effect. my previous parameter 40 was 00000000 and changed to 01000000.

    found a problem with the macro that caused the issue. now works as I intended.
    solved the problem by inserting optional stops M00 to help debug.

    Unless you're using the M00 to stop the run of the Macro program in a specific spot, setting parameter 0011.5 to "1" (assuming a Series 0 control) will cause the program to stop after each Macro Statement block when in Single Block Mode. This can also be achieved without setting this parameter bit by including an EOB after each Macro Statement block. Being able to execute the Macro Program in Single Block is a useful debugging tool.


    Regards,

    Bill

  3. #3
    Join Date
    Sep 2012
    Posts
    182
    thanks for the tip. being able to step through will make debugging much easier!

Similar Threads

  1. Please help with this macro program
    By Behnod in forum Parametric Programing
    Replies: 7
    Last Post: 03-05-2013, 05:09 PM
  2. macro program
    By curly3456 in forum Fanuc
    Replies: 1
    Last Post: 02-04-2012, 11:26 PM
  3. Replies: 2
    Last Post: 03-27-2009, 09:15 PM
  4. G65 macro B PROGRAM
    By gollame in forum G-Code Programing
    Replies: 2
    Last Post: 05-11-2008, 05:26 PM
  5. Macro program
    By pioneerproducts in forum News Announcements
    Replies: 4
    Last Post: 10-08-2007, 09:44 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
  •