+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Newbie level 3
    Points: 55, Level: 1

    Join Date
    May 2016
    Posts
    4
    Helped
    0 / 0
    Points
    55
    Level
    1

    How to implement modbus protocol using uart

    Hi,
    I want to manipulate the data using Modbus protocol over UART and i decided to use PIC24 series microcontroller to implement this process. I studied little bit about MODBUS protocol, but in that their using MTCP gateway as a intermediator. but still i did't get that how to implement this protocol over UART.
    There also two interfaces
    1. RS232/485
    2. Ethernet (TCP/IP)

    Two transmission modes
    1. ASCII mode
    2. RTU mode

    I planned to use via RS232. but i can't to decide which Transmission mode is convenient. please kindly some one give idea about this process.

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 252,684, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,016
    Helped
    13391 / 13391
    Points
    252,684
    Level
    100

    Re: How to implement modbus protocol using uart

    RTU is commonly used. For the implementation details, study the documents available at Modbus.org
    There are also various code examples on the internet.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Super Moderator
    Points: 70,762, Level: 64
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,474
    Helped
    3293 / 3293
    Points
    70,762
    Level
    64

    Re: How to implement modbus protocol using uart

    Hi,

    There also two interfaces
    1. RS232/485
    2. Ethernet (TCP/IP)
    I'd say three:
    1. RS232
    2. RS485
    3. Ethernet (TCP/IP)

    Klaus



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 252,684, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,016
    Helped
    13391 / 13391
    Points
    252,684
    Level
    100

    Re: How to implement modbus protocol using uart

    There also two interfaces
    1. RS232/485
    2. Ethernet (TCP/IP)
    In terms of MODBUS specification, they are different transport protocols, not only interfaces
    1. MODBUS over serial
    2. MODBUS over TCP



  5. #5
    Advanced Member level 5
    Points: 8,876, Level: 22
    Achievements:
    7 years registered
    Easyrider83's Avatar
    Join Date
    Oct 2011
    Location
    Tallinn, Estonia
    Posts
    1,568
    Helped
    359 / 359
    Points
    8,876
    Level
    22

    Re: How to implement modbus protocol using uart

    Anyway, I do not recomend to use 232.
    485 much more relable.
    Basicaly, we can use any phisical layer for MODBUS. But I think, CAN fit better. It has many h/w realized things like confirmation and CRC checking.
    No reason to use such old interfaces in out century.
    Love me or hate me. All infractions will be ignored.



    •   AltAdvertisment

        
       

  6. #6
    Super Moderator
    Points: 252,684, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,016
    Helped
    13391 / 13391
    Points
    252,684
    Level
    100

    Re: How to implement modbus protocol using uart

    No reason to use such old interfaces in out century.
    Objection! Apparently there are many reasons to use it today. You'll find that most HMI devices support as a standard protocol, multi-protocol converters like the HMS Anybus devices have MODBUS as a common protocol, etc., etc.

    RS232 layer isn't suitable for actual bus (multi-drop) topologies, in so far MODBUS over serial mostly uses RS485.



--[[ ]]--