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

Passing parameters through M701

Scheduled Pinned Locked Moved
Firmware wishlist
2
4
176
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.
  • undefined
    Exerqtor
    last edited by Exerqtor 3 Apr 2023, 17:05 4 Mar 2023, 09:44

    Don't know if this is just some stupid idea that won't work in most cases.

    BUT what if we were able to pass a parameter to the /filaments/"filament"/load.g in question through the M701 command?


    For example, I'm using PrusaSlicer and have M701 S"[filament_type]" ; Load filament for the active tool in my filament specific start gcode.

    And my load.g looks like this:

    ; filaments/"filament"/load.g
    ; called when M701 S"filament" is sent
    
    ; ====================---------------------------------------------------------
    ; Settings section
    ; ====================
    
    ; Filament settings
    
    var FilamentType = "ABS"                                                       ; Input the filament type (only for the message)
    
    ; Message placeholders
    var Message1 = "N/A"
    
    ; ====================---------------------------------------------------------
    ; Message section
    ; ====================
    
    ; Generate message
    set var.Message1 = "" ^ var.FilamentType ^ " filament loaded"
    
    ; Filament loaded message
    M118 P0 S{var.Message1}                                                        ; Send message to DWC
    M118 P2 S{var.Message1}                                                        ; Send message to PanelDue
    
    M703                                                                           ; Load filament config.g for the selected filament
    

    And if I was able to pass a paramater like with M98 i could make the load.g files totally agnostic and wouldn't have to add "ABS" etc. manually to all the different load.g's.


    For instance if i could do thisM701 S"[filament_type] F"[filament_type]" ; Load filament for the active tool and pass paramter F in Prusalicer.

    And adapt my load.g's to:

    ; filaments/"filament"/load.g
    ; called when M701 S"filament" is sent
    
    ; ====================---------------------------------------------------------
    ; Settings section
    ; ====================
    
    ; Filament settings
    
    var FilamentType = (param.F)                                                   ; Input the filament type (only for the message)
    
    ; Message placeholders
    var Message1 = "N/A"
    
    ; ====================---------------------------------------------------------
    ; Message section
    ; ====================
    
    ; Generate message
    set var.Message1 = "" ^ var.FilamentType ^ " filament loaded"
    
    ; Filament loaded message
    M118 P0 S{var.Message1}                                                        ; Send message to DWC
    M118 P2 S{var.Message1}                                                        ; Send message to PanelDue
    
    M703                                                                           ; Load filament config.g for the selected filament
    

    If it's viable at all 🤷‍♂️

    undefined 1 Reply Last reply 29 Apr 2023, 03:54 Reply Quote 1
    • undefined
      Surgikill @Exerqtor
      last edited by 29 Apr 2023, 03:54

      @Exerqtor Couldn't you just use a M291 message box in your filament specific start gcode to accomplish the same thing?

      undefined 1 Reply Last reply 29 Apr 2023, 06:55 Reply Quote 0
      • undefined
        Exerqtor @Surgikill
        last edited by 29 Apr 2023, 06:55

        @Surgikill
        Uuuhm, not quite sure I understand what you're hinting too there 🤔

        undefined 1 Reply Last reply 29 Apr 2023, 13:38 Reply Quote 0
        • undefined
          Surgikill @Exerqtor
          last edited by Surgikill 29 Apr 2023, 13:38

          @Exerqtor From the looks of what you are doing, the only thing var FilamentType is being used for is an M118 message. It's not actually affecting the filament that is being loaded, because you need that input in the M701 S"filament" command. Unless you are using this variable in other places.

          Your other option would be to set the variable value in your filament specific start gcode.

          Also, apparently M703 does not work in load.g, from what I have been told.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA