user array variables?
-
My use case would be storing tool specific PA, DAA, retraction etc settings for easier access. Currently this looks like this:
M302 S220 R150 ;Cold extrusion settings var retractionDistance = 0.6 var retractionSpeed = 2100 var pressureAdvance = 0 if state.currentTool == 0 if global.tool0NozzleSize == 0.25 ;set var.pressureAdvance = 0.11 elif global.tool0NozzleSize == 0.4 set var.pressureAdvance = 0.11 elif global.tool0NozzleSIze == 0.8 ;set var.pressureAdvance = 0.11 elif state.currentTool == 1 if global.tool1NozzleSize == 0.3 ;set var.pressureAdvance = 0.11 elif global.tool1NozzleSize == 0.4 set var.pressureAdvance = 0.11 elif state.currentTool == 2 if global.tool2NozzleSize == 0.3 ;set var.pressureAdvance = 0.11 elif global.tool2NozzleSize == 0.4 set var.pressureAdvance = 0.11 elif state.currentTool == 3 if global.tool3NozzleSize == 0.3 ;set var.pressureAdvance = 0.11 elif global.tool3NozzleSize == 0.4 set var.pressureAdvance = 0.11 if state.currentTool >= 0 M207 S{var.retractionDistance} F{var.retractionSpeed} Z0.0 ;firmware retraction settings for PETG M572 D{tools[state.currentTool].extruders[0]} S{var.pressureAdvance}
This would be so much nicer with a lookup table like format.
-
@diamondback Agreed. I'm working around the lack of arrays and it's complicating things a bit.
-
This post is deleted! -
Any news on the feasibility of this? @dc42
Would still love to get support for this and clean up my tool/filament configuration by putting it all in a nice array instead of many many files distributed across /macros -
Any update about the implementation of this topic?
May the 3.4 stable version have this feature?
Thanks!
-
@marcossf it's unlikely to be included in 3.4 stable.
-
@dc42 Thanks David.
-
@dc42 Seeing that there is some work happening on this topic, are there likely gonna be hardware restrictions to user arrays? (Like only being available on Duet 3 hardware etc)
If so, I'd like to know early, I'd happily switch to 3 hardware just for this one feature alone -
@diamondback current plans are to include support for array variables in RRF 3.5 for Duet 2, but to remove some of the kinematics options from the standard build, for example Rotary Delta and Hangprinter.
-
@dc42 Many thanks, your awesome work keeps taking away my arguments to finally switch to Duet 3 hardware
-
@dc42 Just out of interest, will nested arrays be possible? Not strictly needed for my use case, but would certainly further clean up the meta gcode.
-
@diamondback yes.
-
@dc42 Awesome!
-
@dc42
That's very cool
May be too early for details, but...
Out of interest, how would one address the individual values of the multi dimensional array?{MyArray[3[2]]} ?
while iterations < {#MyArray[3]}
echo {MyArray[3[iterations]]} -
@owend it would be: MyArray[3][2]