Modbus UDP

learnetk
2016-09-14
2021-11-04
  • learnetk - 2016-09-14

    Hi Forum,
    Does anyone have an idea how on Modbus UDP communication with CodesysV3. Are there some libraries available for this ?

    Thanks

     
  • Anonymous - 2016-09-16

    Originally created by: scott_cunningham

    The CoDeSys store has a Modbus TCP library for sale. I would think it also support UDP, as this is typically just a setting (at least it is with the products I work with).

     
  • eschwellinger

    eschwellinger - 2016-09-16

    Hi,
    hard to say, but there have been no requests for it, it is not implemented ;-(

    BR
    Edwin

     
  • jzhvymetal - 2016-09-20

    FYI UDP has been implement in the OsCat Network library in both the ModbusTCP Client and Server FBs.

     
  • learnetk - 2016-09-20

    Thanks for the reply.

    Hi jzhvymetal,
    I started with the Network library from OSCAT. My application needs a Client to Broadcast parameters to the Server, but Peewit tells me that thisis not possible with the Library. I havent been able to find any info regarding the Modbus Udp.
    It would be really great if you have any idea on this.

    Thanks and warm regards

     
  • Ulvis

    Ulvis - 2021-11-04

    Any more info on this?

     
  • i-campbell

    i-campbell - 2021-11-04

    I think Modbus UDP is not a good idea.
    UDP has no packet ordering mechanism, and Modbus protocol has no order checking mechanism nor session establishment.

    Example problem with Modbus UDP:
    With Modbus UDP it is possible that your master sends a Read Coils 1 through 8, times out, then sends a Read Coils 9 through 16. And then it receives the (delayed) UPD response containing the coils 1 through 8. The packet response is identical for the two, so it is accepted as the values for the wrong address.

    Modbus UDP has not been standardized.

    So I would not expect any official Modbus UDP Library.

     
  • Ulvis

    Ulvis - 2021-11-04

    Modbus UDP is extensively used for less capable devices that do not need to maintain the TCP socket. It has its flaws though.

    Luckily for now, my clients emergency phone devices are capable of Modbus/TCP so I will ditch the WAGO FbMbMasterUdp implementation in favour of a bog standard Codesys Modbus config editor setup.

    Thanks.

     

Log in to post a comment.