Bad command: endif
-
Running 3.5.4 firmware on my printer, Trying to do a macro for a calibration tool
Here is the problem section of code
; Check if we got a trigger by checking if we moved down significantly
var trigger_detected = move.axes[2].machinePosition < (var.safe_nozzle_height - 0.5) ; Check if we moved down significantly
echo >>"0:/sys/IDEX_Z_offset.log" {state.time}, "Checking trigger detection: ", var.trigger_detected; If no trigger was detected, abort
if !var.trigger_detected
echo >>"0:/sys/IDEX_Z_offset.log" {state.time}, "ERROR: No touch detected - aborting"
M291 S2 R"Error" P"No touch detected after moving 9mm. Check the calibration tool and try again."
M99 ; Exit macro if no trigger
else
echo >>"0:/sys/IDEX_Z_offset.log" {state.time}, "Touch detected successfully"
endifKeep getting the error message - Error: Bad command: endif, It looks right to me but its late and I gotta be missing something. Can someone do a sanity check for me or have I run across something I cannot do?
-
@Macgyver there's no endif in RRF.
You just have to have the code indented correctly. No indent means the if has finished -