• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Problem adding a data source - Modbus Serial

    Hardware
    9
    22
    30.9k
    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.
    • J
      jkyner
      last edited by

      Does anybody know of a USB/RS485 adapter with a reliable Ubuntu device driver that works with Mango? Also, any tips or hyperlinks on how to install the driver to make it work with Mango would be a big help. I know how RS485 works but I just need a few pointers on getting a USB/RS485 adapter to work dependably on Ubuntu.

      I saw Mango described in the latest Modbus.org newsletter and I'm glad I checked it out -- it works well with Modbus-TCP/RTU to a single slave via a Moxa NPort 5130 Ethernet/RS485 adapter. Now if I can just find a USB/RS485 adapter that works as well!

      1 Reply Last reply Reply Quote 0
      • J
        jkyner
        last edited by

        I should have said Mango works fine with a Lantronix Intellibox Modbus Gateway with RTU slaves but also works fine with the Moxa 5130 (a basic Ethernet/RS485 SDA that is not Modbus-aware) for those Modbus slaves that can handle the 6-byte Modbus TCP-RTU header forwarded over RS485.

        1 Reply Last reply Reply Quote 0
        • D
          dparra
          last edited by

          I've a gen-set controller with modbus/RTU connected to a Moxa adapter.
          modpoll (http://www.focus-sw.com/fieldtalk/modpoll.html) works great for test using "Encapsulated Modbus RTU over TCP", but i can't get it running on Mango.

          It's possible to get this device works with Mango?

          Regards,

          David Parra

          1 Reply Last reply Reply Quote 0
          • F
            ftomiBR
            last edited by

            I spent lot of time testing theese serial adapters and realize that the problem was the driver.

            Now I am using an usb/serial adapter to communicate serial devices with Mango, and it works very well.

            If you are having problems try this driver:

            http://www.matsuyama.it/dettaglio/CF215/

            You can use it with your own adapter, or may purchase a new one from website.

            (I am using a cheap adpater with this driver and it works)

            1 Reply Last reply Reply Quote 0
            • D
              dparra
              last edited by

              You're right. USB-Serial adaptors aren't the most compatible peripheral in the world.

              But my problem is different, 'cause i use a Serial to Ethernet adaptor (Moxa calls it "device server"). If i install a driver on my PC, i got a virtual COM port though ethernet.

              When i use modpoll for test (www.focus-sw.com/fieldtalk/modpoll.html) everything works:

              D:\>modpoll -m enc -r 8196 -1 -p 4001 *MyIPAddress*
              
              modpoll - FieldTalk(tm) Modbus(R) Polling Utility
              Copyright (c) 2002-2006 FOCUS Software Engineering Pty Ltd
              Visit http://www.modbusdriver.com for Modbus libraries and tools.
              
              Protocol configuration: Encapsulated RTU over TCP
              Slave configuration...: Address/Id = 1, start reference = 8196, count = 1
              Communication.........: *MyIPAddress*, port 4001
              Data type.............: 16-bit register, output (holding) register table
              
              Polling slave ...
              [8196]: 226
              

              But i can't select "Encapsulated RTU over TCP" on Mango (AFAIK, this protocol is supported).

              I try to configure an Modbus IP data source without luck.
              Transport Type: TCP
              IP: MyIpAddress
              PORT: 4001

              jkyner says:

              also works fine with the Moxa 5130 (a basic Ethernet/RS485 SDA that is not Modbus-aware) for those Modbus slaves that can handle the 6-byte Modbus TCP-RTU header forwarded over RS485.

              Therefore... My Modbus slave is incompatible with mango?

              Thanks a lot!!

              David Parra

              1 Reply Last reply Reply Quote 0
              • M
                mlohbihler
                last edited by

                David,

                Can you make your device available over the internet for testing? It seems "encapsulated RTU" is a different protocol than modbus TCP.

                Best regards,
                Matthew

                1 Reply Last reply Reply Quote 0
                • J
                  jkyner
                  last edited by

                  I think what ModPoll calls "encapsulated RTU" is what Modscan32 calls a "remote telnet server" connection, which just treats the TCP/IP socket like a serial port. That is, just sendng plain Modbus RTU packets via the socket without the extra 6-byte header that Modbus TCP/IP requires.

                  It would be a cool feature for Mango to support that connection type so folks can use cheaper serial device servers with Mango instead of pricey Modbus Ethernet gateways.

                  I can probably connect my Moxa to the Internet for you to test with later this week if David can't make his available.

                  1 Reply Last reply Reply Quote 0
                  • M
                    mlohbihler
                    last edited by

                    Last to connect to the internet's a rotten egg!

                    Best regards,
                    Matthew

                    1 Reply Last reply Reply Quote 0
                    • M
                      mlohbihler
                      last edited by

                      Thanks for setting this up. I've tried sending the (decimal) message [1, 3, 4, 196, 0, 1, 196, 199] to the IP address you gave but i never get a response. I also tried varying the slave id from 0 to 240 but still, nothing but crickets. Can you provide a trace of a message to which this equipment will respond?

                      Best regards,
                      Matthew

                      1 Reply Last reply Reply Quote 0
                      • M
                        mlohbihler
                        last edited by

                        Never mind. Found it at 127.

                        Best regards,
                        Matthew

                        1 Reply Last reply Reply Quote 0
                        • J
                          jkyner
                          last edited by

                          Sorry, I forgot to mention the slave address is 127 (7F hex). Here's a hex dump of the command and reply I just captured with my C# Modbus master program that reads 2 holding registers at address 0 (or addresses 40001 and 40002 in Modbus terminology):

                          8 bytes sent: 7F 03 00 00 00 02 CE 15
                          9 bytes rcvd: 7F 03 04 00 00 00 00 64 34

                          Be sure to use a long enough reply timeout to allow for extra timing delays due the to the Internet. I use a 3 second timeout. Also, the Windows TCP/IP sockets API has some options to help make sure the packet doesn't get fragmented at the Ethernet layer e.g. their's a flag called ClientSocket.NoDelay that should be set true. For Linux, there should be a similar flag.

                          BTW, not very many Modbus slaves support the function code for reading exception data that Mango uses for automatically identifying the slaves on an RS485 drop. A more universal way is to just read some register (40001 is a common one). If the slave has a register at that address, it will give you a normal response. If not, it will respond with "illegal address" exception. Either way, you've discovered that there's a slave at that slave address.

                          1 Reply Last reply Reply Quote 0
                          • J
                            jkyner
                            last edited by

                            Matthew, please post a message here when you have a new version of Mango that works with a "Serial Device Server" option for Modbus serial RTU protocol. That would help put Mango on the same level as Modbus master software like Modpoll and Modscan32 (as far as Modbus protocol support). Then with all of Mango's other features, it would leave them in the dust!

                            Just an FYI for anyone wanting to use an SDS or SDA with Modbus serial RTU protocol: you usually need to tweak the adapter's settings to allow for the way that the protocol determines the end of a packet (i.e. with a silent interval). For the Moxa NPort 5130, I configured it for a "Packing length" of 256 and a "Force Transmit" of 5 milliseconds. This also makes analyzing a communications session with Wireshark easier.

                            Of course the SDA approach doesn't support multiple concurrent sessions like Modbus TCP/IP can, but for a lot of applications that's beside the point.

                            1 Reply Last reply Reply Quote 0
                            • M
                              mlohbihler
                              last edited by

                              BTW, not very many Modbus slaves support the function code for reading exception data

                              Yeah, this has been noted previously. It just took one more mention i guess to motivate a change. (A change suggestion doesn't hurt either, of course. Thanks.) Modbus4J has been updated accordingly.

                              Best regards,
                              Matthew

                              1 Reply Last reply Reply Quote 0
                              • M
                                mlohbihler
                                last edited by

                                The encapsulated RTU changes have been made to Modbus4J and check into the CVS repo, for anyone that uses that package standalone. The changes have also been incorporated into Mango, and will be available in the next version. The only visible change is the "encapsulated" checkbox in the IP configuration.

                                You will see a notice in the Mango that a new version of the product is available, so no explicit posting will be made here for that event.

                                Best regards,
                                Matthew

                                1 Reply Last reply Reply Quote 0
                                • J
                                  joohwan
                                  last edited by

                                  Hello jkyner,

                                  Can you be more specific on the following post you made, please?
                                  I've been trying to put my power meter (connected to Mango via Modbus serial) on our LAN using Moxa 5230 without much success.

                                  What data source should I use to configure/connect to the Moxa 5230?
                                  And what "operation mode" should I choose for Moxa 5230 for Mango to connect?

                                  TIA,

                                  joohwan

                                  @jkyner said:

                                  I should have said Mango works fine with a Lantronix Intellibox Modbus Gateway with RTU slaves but also works fine with the Moxa 5130 (a basic Ethernet/RS485 SDA that is not Modbus-aware) for those Modbus slaves that can handle the 6-byte Modbus TCP-RTU header forwarded over RS485.

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post