Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login
    1. Home
    2. hlwerschner
    3. Best
    • Profile
    • Following 0
    • Followers 0
    • Topics 22
    • Posts 55
    • Best 2
    • Controversial 0
    • Groups 0

    Best posts made by hlwerschner

    • Use of set meta command

      I can not count the places in my macros where I have to use code like

      if !exists(global.xyz)
        global xyz = some complex expression
      else
        set var.xyz = SAME complex expression
      

      This is caused by that HARD restriction that the "set" command EXPECTS the assigned variable to exist. I even may do a

      if !exists(var.xyz)
        var xyz = 0 ; or any fake value
      set var.xyz = to the really wanted expression value
      

      but I am not happy with this - for example the really set value type may not be numeric - but I know that this is an argument of esthetics.

      My sugestion: (a) add another command - perhaps name it "assign" - that is a "set" but automatically will do a create of that variable before if neccessary.
      Or (b) add a gcode like "Mxxx 0 / 1" which defines the behaviour of "set" on a global base.
      Both options will not block to use the old coding but the will help to write cleaner and more secure macros.

      posted in Gcode meta commands
      hlwerschnerundefined
      hlwerschner
    • RE: Using macro calls in config.g

      @fcwilt Ty for your tipps.
      1/ Yes, I do know this. Its simply a coding copy/paste thingy which started when I started to use this "macro-language" or whatever we call it.
      2/ Yes, and I hate it as it creates ugly (but SAFE code) to do:

      if !exists(xxx.vvvvv)
        xxx vvvvv = value
      else
        set xxx.vvvvv = value
      

      This is one of the reasons why I have sub-macros which only do the creation/reuse of global variables which I need to communicate values between macros (sorry: no return values from macros, no parameters "by-name" etc). I have accepted that this macro-meta-coding does not make macros to "good programming" 🙂
      3/ I understand your statement about 3.50 and its current state. I also follow that road for most of my working with 3d printing. But the urge to learn new usage of the great Duet3 hardware and looking into a interesting implementation of input-shaping ... and finally the reason that I do not have needs to use my printer for some "real" work can push me sometimes a bit too far.

      I have to admit that this new releases creates far more trouble than all other versions I had before (I started some years ago with a DUET 2 WiFi board, switched later to the MB6HC which is great and promises to allow 3-Z-axes expansion more easibly and now I sit on that board and wait for some features that I would like to use 🙂

      But ist for learning new stuff even as a retired guy with 75 years !

      posted in Duet Hardware and wiring
      hlwerschnerundefined
      hlwerschner