Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Problems passing parameters from Slicer

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    4
    5
    281
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MaxGyverundefined
      MaxGyver
      last edited by MaxGyver

      Currently, I am experimenting a lot and therefore constantly switching between several slicers.

      Instead of bothering with different slicer scripts that all have their code flavor, i would like to keep the script on the slicer side as simple as possible and merely use it to pass the needed parameters like temperatures or the area of the printed object to the DUET and handle all the conditional gcode there.
      Unfortunately, the parameters are not passed, although everything looks good in the Gcode file:
      I have a DUET36HC in SBC-mode running RRF 3.5 beta 2+

      prusa slicer start script:

      ;Starting script
      
      set global.temp0={first_layer_temperature[0]}
      set global.temp1={first_layer_temperature[1]}
      set global.bedtemp0={first_layer_bed_temperature[0]}
      set global.bedtemp1={first_layer_bed_temperature[1]}
      
      M98 P"0:/sys/start.g"
      

      And my start.g

      ;///start.g
      
      if exists(global.bedtemp0)
          echo {"global.bedtemp0 is = "^global.bedtemp0}
      if exists(global.bedtemp1)
          echo {"global.bedtemp1 is = "^global.bedtemp1}
      
      
      if global.bedtemp0>0 || global.bedtemp1>0
          echo "bedtemp0 or bedtemp1 is >=0"
          if global.bedtemp0 >= global.bedtemp1
              M190 P0 S{global.bedtemp0}
              echo {"heating bed to bedtemp0 of: " ^global.bedtemp0}
          else
              M190 P0 S{global.bedtemp1}
              echo {"heating bed to bedtemp1 of: " ^global.bedtemp1}
      

      Prusa slicer Gcode file:

      ; generated by PrusaSlicer 2.6.0-alpha4+win64 on 2023-03-04 at 15:07:17 UTC
      
      ; 
      
      ; external perimeters extrusion width = 0.90mm
      ; perimeters extrusion width = 0.90mm
      ; infill extrusion width = 0.50mm
      ; solid infill extrusion width = 0.90mm
      ; top infill extrusion width = 0.80mm
      ; support material extrusion width = 0.80mm
      
      M73 P0 R19
      M107 ; disable fan
      M190 S80 ; set bed temperature and wait for it to be reached
      G10 S240 P0 ; set temperature
      ;TYPE:Custom
      ;Starting script
      
      set global.temp0=240
      set global.temp1=240
      set global.bedtemp0=80
      set global.bedtemp1=60
      
      
      M98 P"0:/sys/start.g"
      ...
      
      jay_s_ukundefined 1 Reply Last reply Reply Quote 0
      • MaxGyverundefined MaxGyver marked this topic as a question
      • jay_s_ukundefined
        jay_s_uk @MaxGyver
        last edited by

        @MaxGyver start.g is ran before the gcode is looked at so you can't pass parameters to it.
        Use another file name, like print_start.g

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        1 Reply Last reply Reply Quote 2
        • Phaedruxundefined
          Phaedrux Moderator
          last edited by

          Need a time worm hole to pass something back to start.g

          Better to use it for anything pre-slicer. Like homing, or a heat soak, resetting values, etc.

          Z-Bot CoreXY Build | Thingiverse Profile

          MaxGyverundefined 1 Reply Last reply Reply Quote 2
          • Alex.crundefined
            Alex.cr
            last edited by

            I posted how I handle this problem here:

            https://forum.duet3d.com/topic/31641/how-to-set-heaters-temp-from-prusaslicer-in-start-g?_=1677801339355

            Voron2.4/Duet3 SBC+6HC+3HC+1LC+1HCL(x2) - Delta/Duet2 Wifi - CubePro/Duet2 Wifi+Duex5 - Laser/Duet3 Mini5+ - Cel Robox - U̶p̶3̶0̶0̶+/D̶u̶e̶t̶3̶ ̶6̶H̶C̶+̶LC1̶ - F̶T̶-̶5̶/̶D̶u̶e̶t̶2̶ ̶W̶i̶f̶i̶ - S̶o̶l̶i̶d̶o̶o̶d̶l̶e̶

            1 Reply Last reply Reply Quote 2
            • MaxGyverundefined
              MaxGyver @Phaedrux
              last edited by

              @Phaedrux said in Problems passing parameters from Slicer:

              Need a time worm hole to pass something back to start.g

              Better to use it for anything pre-slicer. Like homing, or a heat soak, resetting values, etc.

              Yep, sometimes it is better to take a break and have a coffee. I really did not see the forest for the trees! 🤦

              1 Reply Last reply Reply Quote 0
              • dc42undefined dc42 has marked this topic as solved
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA