M572's D parameter doesn't process expressions
-
echo {state.currentTool} //Log: 3 M572 //Log: Extruder pressure advance: 0.010, 0.010, 0.010, 0.100 M572 D{state.currentTool} S0.2 M572 //Log: Extruder pressure advance: 0.010, 0.010, 0.010, 0.100
I want to use this to set the pressure advance in a Filament
config.g
file for only the current tool being loaded. -
@garethky said in M572's D parameter doesn't process expressions:
echo {state.currentTool} //Log: 3 M572 //Log: Extruder pressure advance: 0.010, 0.010, 0.010, 0.100 M572 D{state.currentTool} S0.2 M572 //Log: Extruder pressure advance: 0.010, 0.010, 0.010, 0.100
It works for me:
3 Error: Bad command: //Log: 3 Extruder pressure advance: 0.200, 0.200, 0.050, 0.050 Error: Bad command: //Log: Extruder pressure advance: 0.010, 0.010, 0.010, 0.100 Extruder pressure advance: 0.200, 0.200, 0.050, 0.200 Error: Bad command: M572 //Log: Extruder pressure advance: 0.010, 0.010, 0.010, 0.100
Tested on Duet 3 running RERF 3.2 in standalone mode.
btw, command M572 D{state.currentTool} S0.2 is only correct if you have a 1:1 mapping between tool numbers and extruder numbers. Better would be M572 D{tools[state.currentTool].extruders[0]} S0.2.
-
Does using the Pi/SBC make a difference?
I'm running 3.2.0-rc2.
-
I will ask @chrishamm to take a look.
-
@garethky said in M572's D parameter doesn't process expressions:
I'm running 3.2.0-rc2.
Update to 3.2 final?
-
We have identified the problem. The M572 command D parameter is in general an array. DSF/RRF do not currently support array-valued expressions. RRF does allow individual array elements to be expressions, but DSF has no means to pass an array to RRF with expressions as the elements.
We can fix the specific case of passing a single expression as an array quite easily, and this fix will be in the 3.3 release. Fixing the more general case where you need to pass an array expression with more than one element will take a little longer.
-
@dc42 said in M572's D parameter doesn't process expressions:
M572
AHH! That makes sense, I was going to separately ask how that worked because I couldn't figure out the syntax for extruders:
; this doesn't work: M92 E{13.6 * 60}:{13.6 * 60}:{13.6 * 60}:{13.6 * 60}
I'm guessing it would be something more like this, which is more complicated to evaluate as currently no expression can do array assignment:
M92 E{[13.6 * 60, 13.6 * 60, 13.6 * 60, 13.6 * 60]}
I really hope that when variables happen we will be able to declare arrays. I think this is a good case for including that.
-
@garethky said in M572's D parameter doesn't process expressions:
@dc42 said in M572's D parameter doesn't process expressions:
M572
AHH! That makes sense, I was going to separately ask how that worked because I couldn't figure out the syntax for extruders:
; this doesn't work: M92 E{13.6 * 60}:{13.6 * 60}:{13.6 * 60}:{13.6 * 60}
I'm guessing it would be something more like this, which is more complicated to evaluate as currently no expression can do array assignment:
M92 E{[13.6 * 60, 13.6 * 60, 13.6 * 60, 13.6 * 60]}
I really hope that when variables happen we will be able to declare arrays. I think this is a good case for including that.
Your first example should work in standalone mode, but won't work in SBC mode. Your second example (or something like it) is what we plan for release 3.4.