Author Topic: Modbus Inter Frame Gap  (Read 8296 times)

JRobinson

  • Newbie
  • Posts: 13
    • View Profile
Modbus Inter Frame Gap
« on: October 24, 2014, 07:58:56 PM »
I am running a Modbus with multiple slaves from an FMD88-10 RS485 port 2 which is the master.  Bus speed is 9600. The various slaves are polled by custom functions triggered by separate  timers. Occasionally I have a poll that doesn't get a response.

Looking at the bus on an oscilloscope, The missed responses happen when the poll goes out in less then the modbus 3.5 character IFG from the preceding response. The slave device misses the poll as it is not separated from the last frame on the bus by the 3.5 character IFG.

My question (which I hope isn't a case of RTM) is, do I need to ensure the calls to READMB2 are separated by the Modbus minimum 3.5 character IFG? This is not done by the FMD protocol layer?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3170
    • View Profile
    • Internet Programmable PLCs
Re:Modbus Inter Frame Gap
« Reply #1 on: October 25, 2014, 11:52:25 AM »
The PLC send out the Modbus command and wait for a Modbus response from the slave. If counts the number of data bytes received from the slave and when the correct number of response bytes have been received it is passed to the communication handler to verify the response. It does not wait for the additional delay of 3.5 character. The application program (TBASIC) can add the delay if necessary using the DELAY command between consecutive READMOBUS function.

What we found out is that in many applications if you only have single slave connected to the master, you can send consecutive MODBUS commands back-to-back without introducing delay. This allow maximum communication throughput.

When you have multiple slaves connected to the same Modbus master, you should add a small delay before switching the communication to a different slave ID. Usually if you don't change the ID then you can get maximum throughput without adding the delay. To maximize throughput you can do all the communication with the slave of the same ID, then add a small delay before switching to the next ID and so on.


Email: support@triplc.com
Tel: 1-877-TRI-PLCS

JRobinson

  • Newbie
  • Posts: 13
    • View Profile
Re:Modbus Inter Frame Gap
« Reply #2 on: October 25, 2014, 06:22:18 PM »
Thanks for the quick response.

If the bus master is using the message length to establish the framing and not the 3.5 character IFG as the Modbus protocol specifies, that would be a problem for third party slave devices that use the IFG to establish the frame start and hence its validity. The protocol obliges a slave to miss the frame in this case.

I can see that using the frame count to establish framing and thus sending the next frame off earlier will speed up the messaging but only if all the devices on the bus are doing that.

This is simply my understanding of the Modbus protocol so I would be pleased if there were other more knowledgeable interpretations.

The outcome though, is that the user needs to manage the timing for the IFG if the PLC is a master for 3rd party Modbus slaves. To me this is quite acceptable but it would be great to have a note in the documentation.