Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Object Model & Endstop Switches

    Gcode meta commands
    2
    3
    249
    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.
    • dmpmassive
      dmpmassive last edited by

      Hello!

      Wondering if it's possible to check the state of an endstop switch in the object model? Not whether an axis is homed, rather the specific state of the switch regardless of homed?

      Cheers,
      David

      1 Reply Last reply Reply Quote 0
      • OwenD
        OwenD last edited by OwenD

        use
        echo sensors[x].endstops.triggered
        where x= the number of the end stop

        ;check all end stops
        echo #sensors.endstops ^ " endstops found"
        G4 S3; wait 3 seconds
        while iterations < #sensors.endstops
        	echo "endstop-" ^ iterations ^  " Type= " ^ sensors.endstops[iterations].type ^ "state= " ^ sensors.endstops[iterations].triggered
        	G4 S3; wait 3 seconds
        

        output (read from bottom up)

        4/8/2020, 7:53:44 PM 	endstop-2 Type= zProbeAsEndstopstate= true
        4/8/2020, 7:53:41 PM 	endstop-1 Type= inputPinstate= false
        4/8/2020, 7:53:38 PM 	endstop-0 Type= inputPinstate= true
        4/8/2020, 7:53:35 PM 	M98 P"0:/macros/conditional g code macros/check_endstops.g"
        3 endstops found
        
        1 Reply Last reply Reply Quote 2
        • dmpmassive
          dmpmassive last edited by

          Lovely! Thank you!

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