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

Support for RS485 on Duet 6XD and 6HC

Scheduled Pinned Locked Moved
General Discussion
3
36
1.3k
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
    dc42 administrators @developeralgo222
    last edited by 14 Aug 2024, 17:29

    @developeralgo222 M260.1 now takes a F parameter to specify the Modbus function number. See https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m2601-modbus-write-registers-or-coils.

    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 14 Aug 2024, 19:05 Reply Quote 0
    • undefined
      developeralgo222 @dc42
      last edited by developeralgo222 14 Aug 2024, 19:05

      @dc42 First tests on R/W to a single Coil ( M42 = Coil Address(Hex) is 0x002A ) and also multiple coils:

      • Single READ = Works & Single WRITE = Doesn't work -- can't write to single coil

      • Multiple READ = Works & Multiple WRITE = Doesn't Work and come back with an error even though it writes the Value to those multiple coils . i also tried writing to a single coil using F15 and i am able to write it but Duet responds with an Error even though it write to the Single coil

      Note: For single READ test , i turned the coil to ON = 1 manually and read it to see if it was reading from the correct coil and then changed it back to OFF = 0 and read it again

      Also i think there is a mix up between Read & Write functions on Multiple coils . When you send a WRITE function (F15 or F{0x0F} ) it comes back with an error but when you send READ function (F1 or F{0x01} ) command for multiple Coils it shows that the coils values have been updated from 0 (OFF) to 1(ON)

      RW_Coils.png

      Is there a way to get the debug logs easily to see what its sending and the format ?

      undefined 1 Reply Last reply 14 Aug 2024, 21:23 Reply Quote 0
      • undefined
        dc42 administrators @developeralgo222
        last edited by 14 Aug 2024, 21:23

        @developeralgo222 thanks for your feedback. So it looks as though it was sending the correct data for WriteSingleCoil and WriteMultipleCoils even though it returned failure. I've updated the binary at https://www.dropbox.com/scl/fo/gwhkwjg232hd6us8yvr0k/ABiZ84dcbZEb9PYiznBRMZU?rlkey=whab6c638wj8w4hyo2jyvjign&dl=0 with a possible fix.

        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 15 Aug 2024, 01:06 Reply Quote 0
        • undefined
          developeralgo222 @dc42
          last edited by 15 Aug 2024, 01:06

          @dc42 fantastic ,
          i will give the new update a try again

          undefined 1 Reply Last reply 15 Aug 2024, 12:50 Reply Quote 0
          • undefined
            developeralgo222 @developeralgo222
            last edited by developeralgo222 15 Aug 2024, 12:50

            RW_Coils.png

            i run the following commands from the console for tests :

            Write / Read Single Coil using Functions 5 & 1
            M260.1 P1 A1 F{0x05} R{0x002A} B1
            M261.1 P1 A1 F{0x01} R{0x002A} B1
            Write / Read multiple Coils using Functions 15 & 1
            M260.1 P1 A1 F{0x0F} R{0x002A} B1:1:1:1
            M261.1 P1 A1 F{0x01} R{0x002A} B4
            M260.1 P1 A1 F{0x0F} R{0x002A} B0:0:0:0
            M261.1 P1 A1 F{0x01} R{0x002A} B4
            Write / Read Single Coil using Functions 15 & 1
            M260.1 P1 A1 F{0x0F} R{0x002A} B1
            M261.1 P1 A1 F{0x01} R{0x002A} B1
            M260.1 P1 A1 F{0x0F} R{0x002A} B0
            M261.1 P1 A1 F{0x01} R{0x002A} B1

            From the R/W Coil tests, Only Single WRITE (Command below) to the coil using Function 5 does not work. It actually doesn't WRITE anything at all to the coil .

            M260.1 P1 A1 F{0x05} R{0x002A} B1
            
            undefined 1 Reply Last reply 15 Aug 2024, 17:13 Reply Quote 0
            • undefined
              dc42 administrators @developeralgo222
              last edited by 15 Aug 2024, 17:13

              @developeralgo222 please try the latest binary at https://www.dropbox.com/scl/fo/gwhkwjg232hd6us8yvr0k/ABiZ84dcbZEb9PYiznBRMZU?rlkey=whab6c638wj8w4hyo2jyvjign&dl=0.

              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 15 Aug 2024, 19:04 Reply Quote 0
              • undefined
                developeralgo222 @dc42
                last edited by 15 Aug 2024, 19:04

                @dc42 great , let me give it a try

                undefined 1 Reply Last reply 15 Aug 2024, 19:32 Reply Quote 0
                • undefined
                  developeralgo222 @developeralgo222
                  last edited by developeralgo222 15 Aug 2024, 19:32

                  RW_Coils.png

                  i tried the following tests from the console and everything seems to be working ok.

                  ;Write / Read Single Coil using Functions 5 & 1
                  M260.1 P1 A1 F{0x05} R{0x002A} B1
                  M261.1 P1 A1 F{0x01} R{0x002A} B1
                  M260.1 P1 A1 F{0x05} R{0x002A} B0
                  M261.1 P1 A1 F{0x01} R{0x002A} B1
                  ;Write / Read Single Holding Registers using Functions 6 & 3
                  M260.1 P1 A1 F{0x06} R{0x002A} B1
                  M261.1 P1 A1 F{0x03} R{0x002A} B1
                  ;Write / Read multiple Holding Registers using Functions 16 & 3
                  M260.1 P1 A1 F{0x10} R{0x002A} B1:1:1:1:1
                  M261.1 P1 A1 F{0x03} R{0x002A} B5
                  M260.1 P1 A1 F{0x10} R{0x002A} B0:0:0:0:0
                  M261.1 P1 A1 F{0x03} R{0x002A} B5

                  Please can you generate all the 3.6.Alpha4 binaries including WebControl so that i don't get Version mismatch for the other boards and i can continue working & testing this version as you work to finish it and resolve any bugs if any

                  undefined 1 Reply Last reply 15 Aug 2024, 20:09 Reply Quote 0
                  • undefined
                    dc42 administrators @developeralgo222
                    last edited by 15 Aug 2024, 20:09

                    @developeralgo222 you can find 3.6 alpha 4 binaries for expansion boards at https://www.dropbox.com/scl/fo/cckwiq91gn16hvl1zdjnp/AF0SMEtkVfiArSPeYaBDGPY?rlkey=kqkknk9q1kiq684u4s55ce8d4&dl=0. There isn't an alpha 4 DWC yet.

                    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 15 Aug 2024, 22:27 Reply Quote 0
                    • undefined
                      developeralgo222 @dc42
                      last edited by developeralgo222 15 Aug 2024, 22:27

                      @dc42 The tests are great . No errors so far . Looks good

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