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

Reading general-purpose inputs in Duet Mini 5+ returns null?

Scheduled Pinned Locked Moved Solved
Gcode meta commands
3
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.
  • undefined
    jwilo
    last edited by 14 Apr 2024, 15:39

    Hi all,

    Just started using Duet/RRF for the first time, and am working on homing routines for a dual head PnP machine.

    I'm trying to read a general purpose input (not an endstop) in the Z axis homing G file, in addition to reading it via DWC.

    In DWC I'm using "M409 K"sensors.gpIn[0].value" which just returns null, as below. If I try to return the whole list of inputs, I get null too. This leads me to believe I need to configure the inputs, but can't see any M code to do this.

    {
        "key": "sensors.gpIn[0].value",
        "flags": "",
        "result": null
    }
    

    Trying to run the below in a script, returns "G28 Z
    Error: in file macro line 7 column 4: meta command: array index out of bounds
    Error: Homing failed"

    Again the out of bounds error implies I'm accessing a sensor in the list of gpIn sensors, that doesn't yet exist because I've not configured it.

    G91               ; relative positioning
    if sensors.gpIn[0].value = 1
    	G1 H1 Z-105 F100 ; move Z down until the endstop is triggered
    else
    	G1 H1 Z105 F100 ;	move Z up in this case
    G92 Z0            ; we're zeroed now, so set this position as Z0
    

    Appreciate any steer on this, I'm sure it's something simple - either need to configure the inputs, or a syntax error on my behalf...

    undefined 1 Reply Last reply 14 Apr 2024, 17:31 Reply Quote 0
    • undefined jwilo referenced this topic 14 Apr 2024, 16:04
    • undefined
      wayneosdias @jwilo
      last edited by 14 Apr 2024, 17:31

      @jwilo
      You should prolly add the config to see what youre working with.

      undefined 1 Reply Last reply 15 Apr 2024, 23:09 Reply Quote 0
      • undefined jwilo marked this topic as a question 14 Apr 2024, 17:40
      • undefined
        jwilo @wayneosdias
        last edited by 15 Apr 2024, 23:09

        @wayneosdias said in Reading general-purpose inputs in Duet Mini 5+ returns null?:

        @jwilo
        You should prolly add the config to see what youre working with.

        For reference, for anybody interested - @wayneodias and I resolved this over at https://groups.google.com/g/openpnp/c/qxq_8FXAPTI whilst I was waiting for my account to become fully active

        undefined 1 Reply Last reply 16 Apr 2024, 16:54 Reply Quote 0
        • undefined jwilo has marked this topic as solved 15 Apr 2024, 23:09
        • undefined
          dc42 administrators @jwilo
          last edited by 16 Apr 2024, 16:54

          @jwilo I'm glad you were about to solve it. Please post again in a new thread if you require help on any other configuration issues. I monitor the OpenPnP group but as my primary function isn't support, I don't look at it every day.

          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

          undefined 1 Reply Last reply 3 May 2024, 23:13 Reply Quote 0
          • undefined
            jwilo @dc42
            last edited by 3 May 2024, 23:13

            @dc42 Thanks! I've only been using Duet for a couple of weeks now, but I'm really impressed with what yourself and the team have put together.

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