Conditional on G29 S0 or S1



  • Conditional to do a G29 S0 if heightmap.csv doesn't exist.
    RepRapFirmware for Duet 3 MB6HC version 3.1.1 running on Duet 3 MB6HC v1.01 or later (SBC mode)

    Something like:
    if heightmap.csv exists do G29 S0 else do G29 S1.

    Tried searching and got nowhere.



  • you could perhaps use the exec on mcode thing and have the pi check for the file and in turn execute some gcode from the pi's shell?


  • administrators

    I haven't tested it, but this may work:

    G29 S1
    if result > 1
      G29 S0
    


  • G29 S1
    if result > 1
    G29 S0
    When I deleted the heightmap.csv:
    G32
    Error: G29: Failed to load height map from file heightmap.csv: Could not find file '/opt/dsf/sd/sys/heightmap.csv'.
    35 points probed, min error -0.170, max error 0.168, mean 0.000, deviation 0.089
    Height map saved to file heightmap.csv

    After a system page refresh, it's there.

    Then I changed it to:
    G29 S1
    if result > 1
    G29
    It works with no errors



  • @Stephen6309 said in Conditional on G29 S0 or S1:

    G29 S1
    if result > 1
    G29
    It works with no errors

    I was just playing with this.
    Since I have a heated bed and also use the filaments/config.g to set different bed temps depending on the filament loaded - the bed heights could vary, but I haven't really seen that in real life. With that being said, I always do G29 with the bed heated to the filament's config.g settings. So depending on the different filaments in the DWC profiles, bed warp-age could vary - so not one bed height.csv for all. Hence this:

    G29 S1 [P{move.extruders[0].filament^".heightmap.csv"}]
    if result > 1
       G29
       G29 S3 [P{move.extruders[0].filament^".heightmap.csv"}]
    

    Will yield:

    G29 S3 [P{move.extruders[0].filament^".heightmap.csv"}]
    Height map saved to file 0:/sys/PETG.heightmap.csv
    

Log in to reply