501,588 active members
5,331 visitors online
Register for free
Login
Page 2 of 2 12
Results 13 to 19 of 19
  1. #13
    Member
    Join Date
    Jun 2015
    Posts
    2710

    Re: Passing arguments through layered macros

    timber....? timber = wood (material)
    so far i believed that when stuff happens, people used to scream timbeeeeeeer but i had no clue that it is a wood ?!
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  2. #14
    Registered
    Join Date
    Jun 2014
    Posts
    77

    Re: Passing arguments through layered macros

    I guess your in Antarctica (lol) so you got no wood lol

  3. #15
    Registered
    Join Date
    Jun 2014
    Posts
    77

    Re: Passing arguments through layered macros

    Ive just come across another aspect i cant get my head around. When calling a sub or macro, we have 33 common variables we can pass through. How do you pass them all through. Just running a test i can only pass through 25 or them.

    G65 <prog> ABCDEFGHIJKLMNOPQRSTUVWXYZ ??????
    ok so they all pass through except 'N' (probably because N is used for line number references)
    how do I pass through 'N' and variables #27-#33?

  4. #16
    Member
    Join Date
    Jun 2015
    Posts
    2710

    Re: Passing arguments through layered macros

    hello zedodia unfortunately, i can't help with such specifics, because i don't know that control/machine, etc; maybe you should ask such particularities inside the fanuc forum : https://www.cnczone.com/forums/fanuc/

    also, so far, the fattest soubroutine that i made was using 30-40 variables, but most of them were declared inside the soubroutine, and only a few of them ( maybe 5 ? ) were passed through layered macros; something like this :

    Code:
        main program
        call soub lv01 = v1 lv02 = v2 lv03 = v3 lv04 = v4 lv05 = v5
        end
    
        soub
        lv06 = 06
        lv07 = 07
        lv08 = 08
        // bla bla bla :)
        lv34 = 34
        lv35 = 35
    
        // at this point, it does not matter that lvo1-lv05 are passed through layers, and that lv06-lv35 are not passed
        // all what maters is that all required variables are initialized; does not matter how :)
    
        // do something with variables lv01, lv02, .., lv35
    
        end
    when you use a certain amount of variables, like more then 10, 20, etc, code complexity increases, and, even if it works, you may hit into a case where you may realize that you lose too much time with configuring the input data, because there are too many values ... i am not saying that one should give up, but, i am saying that there are methods to deliver faster initializations for complex parametric codes, like using presetting programs, or pc software / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  5. #17
    Registered
    Join Date
    Jun 2014
    Posts
    77

    Re: Passing arguments through layered macros

    Too easy. I agree with what your saying. However while complex at first, in the end will make my job very simple and quick to configure. thankyu for your help

  6. #18
    Member
    Join Date
    Jun 2015
    Posts
    2710

    Re: Passing arguments through layered macros

    i have some parametric codes, and they deliver nice toolpaths, with minimal auxiliar movements, etc

    but, because of their complexity, sometime i spent too much time configuring them, because i have to check then entire range of variables, and, in the end, i change a few ... in other words, there are too many parameters involved, and too many possible code outputs, that simply blows my head off sometime i need too much time to understand the structure of an old soubroutine, so i have, on my 2 do list, a method for faster parametric initializations, but i did not yet had time to work on it; however, it should be based on some images, because images are faster too see&understand, than reading code

    at begining, my codes were simple&short, but, in time, they got larger, so to handle specific particularities, and also to deliver optimized behaviour : they work, but being so complex, requires too much time to understand and configure them; now, i just need to boost the initialization time, because, now, i reached a limit of my-self, beyond which i am no longer productive / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  7. #19
    Registered
    Join Date
    Sep 2010
    Posts
    1222

    Re: Passing arguments through layered macros

    Quote Originally Posted by zedodia View Post
    Thanks Deadlykitten for the long winded answer.
    Hello zedodia,
    Empty vessels make the most noise.

    With regards to your question,

    In your example code below, there would be no requirement to pass #100 and #101 in MACRO1 PROG and MACRO2 PROG respectively, as they are Common Variable, seen by all programs.

    MAIN PROG
    #100=40
    #101=60
    G0 X0 Y0 Z0
    G1 X100 Y100 Z0
    G65 <MACRO1> A20 <----A20 MAKES LOCAL VARIABLE #1=20
    G0 X0 Y0
    M2

    MACRO1 PROG
    G1 Z#1
    G1 Z0
    G65 <MACRO2> B#100
    M99

    MACRO2 PROG
    G1 Z#2
    G1 Z0
    G65 <MACRO3> C#101
    M99

    MACRO3 PROG
    G1 Z#3
    G1 Z0
    M99

    If you wanted to pass Local Variables through Nested Macro Programs and not set Common Variables in your Main program, you could pass all of the Local Variables used in MACRO1 PROG, MACRO2 PROG and MACRO3 PROG via the Call Block in MAIN PROG.

    G65 A20 B40 C60 (IN MAIN PROG)

    then

    G65 B#2 C#3 (IN MACRO1 PROG)

    and

    G65 C#3 (IN MACRO2 PROG)


    Regards,

    Bill

Page 2 of 2 12

Similar Threads

  1. Passing parameter as arguments in G65
    By biqut2 in forum G-Code Programing
    Replies: 0
    Last Post: 07-31-2015, 04:31 PM
  2. Passing parameter as arguments in G65
    By biqut2 in forum General CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 07-31-2015, 04:18 PM
  3. Plasma- Multiple layered AL thin sheet cutting?
    By diyengineer in forum General Waterjet
    Replies: 2
    Last Post: 08-22-2011, 12:06 AM
  4. Foil layered foam
    By webdude12 in forum Composites, Exotic Metals etc
    Replies: 0
    Last Post: 10-23-2009, 08:15 PM
  5. passing arguments to a sub program
    By kiprip in forum Mazak, Mitsubishi, Mazatrol
    Replies: 1
    Last Post: 07-13-2006, 05:11 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
  •