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

    Real-time gcode stream (window) for current job?

    Scheduled Pinned Locked Moved Solved
    CNC
    3
    4
    349
    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.
    • HebigTundefined
      HebigT
      last edited by HebigT

      Many commercial CNC software have a dedicated window that shows a real-time stream of gcode commands.

      I'd like to create a plugin to do the same - but have no idea how realistic it is or where to start.

      I think Sandarius's gcode viewer offers some similar functionality in that it loads the current job and gives a visual preview of commands to come.

      Would it be sufficient to simulate the active job in parallel, provided that they both start (and remain) synchronized?

      Any thoughts are appreciated!

      1 Reply Last reply Reply Quote 2
      • chrishammundefined
        chrishamm administrators
        last edited by

        @hebigt You need to watch job.file.fileName in the object model and download the entire file once it changes. If you want to implement it in Vue (backend of DWC), map it to your component using Vuex mapState and create a watcher. Then you can keep track of job.filePosition (provided it isn't null) and highlight everything up to that position. Just bear in mind that the reported file position may not be equal to the move being executed but to the last buffered command, because RRF tries to look ahead (usually) 2 seconds to maintain jerk-free motions. That is especially necessary during circular motions with lots of short G0/G1 commands. @Sindarius should be able to explain more in-depth how live movement is visualized in the G-code viewer.

        Duet software engineer

        1 Reply Last reply Reply Quote 2
        • Phaedruxundefined Phaedrux moved this topic from General Discussion
        • Sindariusundefined
          Sindarius
          last edited by

          I think the best that can be done is real-ish time due to buffering that happens in RRF. On that note I have been working on incorporating the current gcode in the 3d viewer for live and simulated viewing. However, that is not on my higher priority list at the moment so I can’t provide an ETA on it yet.

          https://youtu.be/03zWpqM9jDA

          HebigTundefined 1 Reply Last reply Reply Quote 2
          • HebigTundefined HebigT has marked this topic as solved
          • HebigTundefined
            HebigT @Sindarius
            last edited by

            @Sindarius @chrishamm Thank you for the feedback on this!

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