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

    Passing macro argument to custom mcode

    Scheduled Pinned Locked Moved
    Gcode meta commands
    2
    2
    121
    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.
    • azs123undefined
      azs123
      last edited by

      Hi. Im trying to implement filament run-out handler using python dsf. I want to send custom mcode with parameter as shown on the screenshot: Zrzut ekranu 2023-12-04 082127.png
      When error occurs on one of the sensors, i want to forward 'D' parameter to dsf. "echo {param.D}" works fine and prints extruder number as expected. However, when trying to catch this mcode in dsf, parameter 'S' is equal to string "{param.D}" instead of actual extruder number:

      6b4c1c51-2a7a-4d0c-976b-2fe441779d26-obraz.png

      I wonder if this is a bug, limitation or i'm doing something wrong. Currently using RRF 3.4

      chrishammundefined 1 Reply Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators @azs123
        last edited by

        @azs123 You need to call EvaluateExpression in your custom code handler to get the actual value of that parameter if it is an expression. Afair there is another code parameter property to flag this.

        Duet software engineer

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