Klipper Macro Params Value Issue

Hello, I encountered a problem with a macro that I am using. I simply want to call a macro and feed it the current extruder temperature. The macro is defined as follows:

[gcode_macro T0] #Mosquito Hotend
variable_dummy: 1
variable_temp:190
gcode:
{% set EXTRUDER_T = params.EXTRUDER_TEMP|default(230)|int %}
SET_GCODE_VARIABLE MACRO=T0 VARIABLE=temp VALUE={EXTRUDER_T}
TOOL_PICKUP ZONE_X=485 ZONE_Y=50 PARK_X=485 PARK_Y=-43 OFFSET_X=-0.75 OFFSET_Y=38.4 OFFSET_Z=5.29 EXTRUDER_NAME=extruder
EXTRUDER_TEMPERATURE={EXTRUDER_T}

[gcode_macro T0] #Mosquito Hotend
variable_dummy: 1
variable_temp:190
gcode:
{% set EXTRUDER_T = params.EXTRUDER_TEMP|default(230)|int %}
SET_GCODE_VARIABLE MACRO=T0 VARIABLE=temp VALUE={EXTRUDER_T}
TOOL_PICKUP ZONE_X=485 ZONE_Y=50 PARK_X=485 PARK_Y=-43 OFFSET_X=-0.75 OFFSET_Y=38.4 OFFSET_Z=5.29 EXTRUDER_NAME=extruder
EXTRUDER_TEMPERATURE={EXTRUDER_T}
TOOL_PICKUP is another macro which is called and the parameters that follow are needed inside that macro. But I want to focus on the the macro above. When I call the macro like so: T0 EXTRUDER_TEMP=235 , it actually sets the GCODE Variable temp to "0" . If I define it to be a "float" instead of an "int". It sets it to "0.0" Does anyone have an idea why ? By the way, if I call the macro like so: T0 , it sets the variable temp to "230". Any help greatly appreciated ✌️
1 Reply
rare-sapphire
rare-sapphire2y ago
solved For everyone interested: A GCode Macro, which is named with a single letter followed by a number (e.g.: T0, K1, P5, B9) and is fed with a parameter, there must not be an equal sign between the parameter's name and the value, when the macro is called followed by the parameter. So in my example above: T0 EXTRUDER_TEMP=235 WRONG T0 EXTRUDER_TEMP235 CORRECT Whereas, if the macro's name was for example Test_Macro : Test_Macro EXTRUDER_TEMP=235 CORRECT Test_Macro EXTRUDER_TEMP235 WRONG
Want results from more Discord servers?
Add your server