modbus TCP protocol

R

Thread Starter

raghavendra

Hi,

Please let me know modbus is a synchronous or asynchronous protocol. i searched and came to know RTU is synchronous and ASCII is asynchronous. Please guide me wht about TCP.

it supports both synchronous and asynchronous?
 
F

Fred Loveless

Greetings, Typically a Modbus function call specifies the starting register address and the number of registers to read. How the calls are made to the device are up to the designer of the communications tool used to get data. Kepware's Modbus drivers all do synchronous processing of the requests starting with reads of multiple registers at the first address.

Now on a serial line the best way to request device data it to poll each of the devices one at a time. With Ethernet you should be able to spawn separate simultaneous connections to the controllers. Again this is up to the designer of the communications package.
 
Hello,

MODBUS RTU, MODBUS TCP and MODBUS ASCII are asynchronous.

A master can issue a read and the slave can respond to the master when it wants to respond and the master can issue the next read when it wants to issue it.

There is not a synchronized timing component to the protocol. MODBUS RTU has a bit of one because the 3½ character times for detecting the end of the message but, that is a message framing issue on serial lines.

While the protocol is ‘request/response’ that does not define the protocol as synchronous or asynchronous; there is no time component.

While you can talk about how a master handles issuing its reads that does not change the protocol.

While you can talk about a master having concurrent connections to one slave, that does not change the protocol. Each connection stands alone.

If you want to discuss the protocol on hardware (232, 485, etc.) you can look at the media and make a call about how it works. That does not change the protocol.

My2c.

Good luck,

Mark
http://peakhmi.com/
 
As others said Modbus is a synchronous protocol.
It is master/slave.
The master sends a request to a slave and the slave sends back a response.
This is independent from Ascii/RTU serial line or TCP.

Here is our Modbus implementation.
http://tinyurl.com/az4llre
You can walk trough the source code and
will learn how it works.
 
R
Hi thanks for the reply ..

you mean we can make our master (client) as synchronous or asynchronous to communicate to the modbus PLC (slave) based on our requirement? right?
 
L

Lynn August Linse

Be careful of the use 'sync' vs 'async' on protocols. The statement "RTU is synchronous and ASCII is asynchronous" makes no sense at all. They are the same - half-duplex - where a Master polls a slave, which can only answer when polled. Modbus/TCP is similar, with the difference that a device can act as master & slave at the same time, but on different TCP sockets. So any 1 socket is still Master-Slave in a half-duplex manner.

Even online, more modern definitions of 'synchronous communications' states both ends need to work with a synchronized clock (like a phone conversation), whereas async comms take place outside realtime (like email messages). Clearly, no version of Modbus schedules messages with synchronized clocks.
 
Hello,

No.

The words synchronous and asynchronous have clear meaning.

Synchronous

1. Occurring or existing at the same time.
2. Moving or operating at the same rate.
3. Having the same frequency or period; in phase.

None of the above can be used to describe the MODBUS protocol.

Therefore, the MODBUS protocol is asynchronous.

Asynchronous

1. not occurring at the same time.
2. beginning each operation only after finishing the preceding one.

Both definitions can be used to describe the MODBUS protocol.

Good luck,

Mark
http://peakhmi.com/
 
J

James Ingraham

Modbus is NOT synchronous.

"The master sends a request to a slave and the slave sends back a response."

Right. Asynchronously. The master can send a request whenever it wants. Or not. It can try to send requests at a specific internal, or it could send them at random times. The slave will respond to each message, but not within any given time frame. It could respond within microseconds, or (theoretically) wait a week before sending a response. There is nothing synchronous about any of this.

-James Ingraham
Sage Automation, Inc.
 
S
Seems like everyone holds a different definition for "synchronous". Here's the definition as I understand it: synchronized (or maybe "coordinated"), but not necessarily simultaneous. IOW the tx and rx and coordinated and must occur in a certain phase relationship. In async, the two streams of events can each proceed based on their own criteria without reference to what the other event stream is doing.
 
I see this is an old thread but I thought I would chime in...

The answers to the question "Is Modbus synchronous or asynchronous are almost all off the mark here. Synchronous or asynchronous are implementation terms. The Basic Modbus protocol specification does not describe implementation details. However, the basic Modbus response does not contain information necessary to map the data array to Modbus registers without knowing what registers were requested. Therefore it is necessary to receive the response following its corresponding request for data (read synchronous). However, the Modbus TCP implementation of the Modbus protocol, wraps the Modbus requests and responses in a TCP packet header that includes a transaction ID. Therefore with Modbus TCP, you can send multiple requests without waiting on their corresponding responses. The responses will be received later and not necessarily in the same order that they were requested in, but the transaction id allows the proper mapping of request to response. This would be considered an Asynchronous implementation of Modbus.
 
Top