Setting global variable positions... pls god help
-
Hello,
I am struggling to create global variables for various positions (my application is for the locations for tool pickup/dropoff for an E3D Toolchanger).
Ideally it would be set so when called it would be:
G1 X{T1_ready[0]} Y{T1_ready[1]}
or similar if T1 is reserved for the tool command. However I cannot seem to actually initialize an array. I have tried:
global T1_ready = {81.5, 210}
but keep getting the error:
set global t1_ready = {1, 2}
Error: meta command: expected a global or local variableI have tried adding braces to various parts of the command (after the variable declaration, etc). I should note that there is currently no variable with the name t1_ready.
I have also tried using the precursor "set" but that throws this error:
So then I tried:
global t1_ready = null; set global.t1_ready = {1,2};
which produces this error:
What am I doing wrong?
PS: It seems like the documentation is not clear enough on this, some more examples would go a long way for this. Also note that the example in "Global Variable Decleration" is incorrect as it uses
set global.T1heat=0
instead of just:
global T1heat = 0
This may be a poor example as I think T1heat is already a default global variable. Maybe change the name to something that's not an automatic default?
-
@Merlin246 What version of RepRapFirmware are you using? Arrays have only been supported since RRF 3.5b1.
Ian
-
@droftarts ahhhh ok that explains it. I'm on 3.4.3.
In the meantime just set single value variables? such as:
global t1_ready_X = 81.5 global t1_ready_y = 210
Is there a way to denote using periods instead? Syntax would be t1.ready.X, t1.pick.X, t1.ready.speed, t1.pick.speed, for example (it would be the class of positions, speeds etc for the tool).
-
@Merlin246 said in Setting global variable positions... pls god help:
Is there a way to denote using periods instead?
No.