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

    Issues sensor reading and wait for reply via USB

    Scheduled Pinned Locked Moved
    General Discussion
    2
    6
    162
    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.
    • drivetrainsystemsundefined
      drivetrainsystems
      last edited by

      Can anyone tell me of a reasonable way to read from a sensor and get a reply back (programmatically) via USB? I have many commands queued up, and I have no way of knowing if the machine is ready to take my sensor reading (is in position). So, I need to issue the command, and once the queue of commands gets around to processing it, I need to get the sensor value.

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

        @drivetrainsystems USB is a serial channel so there is always the problem that commands you send get delayed when the motion queue is full. We've considered adding a second CDC channel over the USB interface on Duet 3 boards to alleviate this, however very few people use USB to control 3D printers using Duet because network control is more convenient.

        You can retrieve sensor status over USB using the M409 command to extract the status from the object model. The response includes the parameters of the query, so if more than one response is outstanding you can distinguish the responses.

        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

        drivetrainsystemsundefined 1 Reply Last reply Reply Quote 0
        • drivetrainsystemsundefined
          drivetrainsystems @dc42
          last edited by

          @dc42 does the REST API not queue commands, but wait for a return value of sensor readings?

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

            @drivetrainsystems when you refer to the REST API do you mean the network interface?

            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

            drivetrainsystemsundefined 1 Reply Last reply Reply Quote 0
            • drivetrainsystemsundefined
              drivetrainsystems @dc42
              last edited by

              @dc42 I'm referring to DuetSoftwareFramework/REST-API, but I'm interested in any interface that will let me know when a given command is finished executing and/or let me find the result of a given command.

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

                @drivetrainsystems if you are using a Single Board Computer attached to the Duet using SPI then you can read the object model from Duet Software Framework, either in a plugin or via the REST API.

                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