so far i believed that when stuff happens, people used to scream timbeeeeeeer :) but i had no clue that it is a wood ?!Quote:
timber....? timber = wood (material)
Printable View
so far i believed that when stuff happens, people used to scream timbeeeeeeer :) but i had no clue that it is a wood ?!Quote:
timber....? timber = wood (material)
I guess your in Antarctica (lol) so you got no wood lol
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?
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 :
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 :)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
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
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 :)
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
Argument specification II uses A, B, and C once each. Apart from
these three letters, it uses I, J, and K up to 10 times each (i.e., 10 independent
sets of I, J, and K are used). Thus, it can pass initial values to
all the 33 local variables.
I can post more details if you are interested.
You seem to be familiar with argument specification I only. In this method, L, O, N, G, and P cannot be used for passing variable. (I remember this as LONG Program)