Help in modbus protocol implementation

Discussion in 'The Projects Forum' started by JotaTR, Aug 21, 2013.

  1. JotaTR

    Thread Starter New Member

    May 6, 2013
    5
    0
    Hi there,

    I would like some guidance about implementing the modbus protocol in a measuring system. This may sound a silly question but where it goes:


    1- I have been reading some stuff that i found out over the internet and as far as i am concerned, in order to implement the modbus protocol in a system i need sensors that deal with modBus protocol (Slaves) and a master device (i can use a micro controller right?). Am i rigt?
    2- The next step to implement the modbus protocol would be program the microcontroller by code respecting the modbus protocol?
    3- Is there any develpment software like a GUI for modbus or should i use the microcontoller software and program all the code by myself?

    Thanks and i am sorry if any question is too obvious.
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,563
    2,378
    I have not found too much on Modbus and the PICmicro for example, but there is alot of info on the Modbus site and you can download one of the serial simulators for testing a PIC using the USART interface.
    The Modbus protocol is fairly simple, just one master and from one to a number of slaves, send a small packet of info and receive the answer with a CRC at the end.
    Do you have to interface with a present Modbus system or is this your own system that needs an interface?
    The reason I ask is if it is one-to-one then RS232 or RS420 could work?
    Max.
    .
     
  3. JotaTR

    Thread Starter New Member

    May 6, 2013
    5
    0
    Hi.

    Sorry for taking so much to reply to your answer. I need t implement modBus on the system so i suppose the answaer would be: It is the system that needs an interface. What i need e connect several sensor to a PIC using ModBus protocol

    Thanks
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,364
    Modbus protocol is simple and straight forward. You can write the code yourself.
    If you are interfacing to existing system or devices then you need to follow the Modbus protocol.
    However, you only need to implement the commands that will be used.

    If you are creating your own bus similar to Modbus then you are free to modify the protocol to suit your requirements.
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,563
    2,378
    I just used USART programming, as mine was a single drop I used RS232, but if you need multi-drop then RS422 will interface up to 10 drops.
    Modbus also can be set for ASCII or RTU type mode.
    Max.
     
  6. JotaTR

    Thread Starter New Member

    May 6, 2013
    5
    0
    Thanks a lot for the answers. So i will start programming the protocol, it seems simple to implement
     
Loading...