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

    "exists" function help

    Scheduled Pinned Locked Moved
    Gcode meta commands
    3
    6
    375
    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.
    • tristanryerparkeundefined
      tristanryerparke
      last edited by

      Hey all, I can't get the "exists" function working to check for a macro parameter. Since it was in the list of functions in the meta commands page I expect that it is used like so:

      if exists(param.C) = true
      	echo param.C
      else
      	M118 P0 S"No C parameter"
      

      But the above script gives me this error:

      Error: Failed to read code from macro grab_slotx.g: Failed to evaluate "exists(param.C) = true": expected an identifier
      

      Am I doing this right? All the documentation I could find was that the "exists" function is now implemented.
      Thanks,
      T

      OwenDundefined 1 Reply Last reply Reply Quote 0
      • OwenDundefined
        OwenD @tristanryerparke
        last edited by

        @tristanryerparke
        Try just

        if exists(param.C)
        
        	echo param.C
        
        else
        
        	M118 P0 S"No C parameter"
        
        tristanryerparkeundefined 1 Reply Last reply Reply Quote 0
        • tristanryerparkeundefined
          tristanryerparke @OwenD
          last edited by

          @owend tried cutting and pasting your code, still got the same error. Maybe its not avaliable on SBC yet?
          T

          dc42undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @tristanryerparke
            last edited by

            @tristanryerparke which firmware version are you running?

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            tristanryerparkeundefined 1 Reply Last reply Reply Quote 0
            • tristanryerparkeundefined
              tristanryerparke @dc42
              last edited by

              @dc42 Sorry, should have mentioned in the original post, 3.3rc1 with DSF 3.3rc1.

              dc42undefined 1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators @tristanryerparke
                last edited by dc42

                @tristanryerparke there is a problem passing macro parameters from DSF to RRF in 3.3RC1. Try the RRF 3.3RC1+1 files at https://www.dropbox.com/sh/dlb58vkmu1u4fkx/AAAelkXSfRKVwI6_yqRnhGHPa?dl=0, or the RRF 3.3RC1+2 files at https://www.dropbox.com/sh/urr3rbnawf9ehcq/AAA_frdT0tcOXVlPUz3bHKU8a?dl=0.

                I have tested an example similar to yours using the 3.3RC1+2 files in standalone mode. If you still can't get it working in SBC mode using these files then I will ask @chrishamm to take a look.

                Duet WiFi hardware designer and firmware engineer
                Please do not ask me for Duet support via PM or email, use the forum
                http://www.escher3d.com, https://miscsolutions.wordpress.com

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