D
After much reading, I have nwo gotten myself confused as to the differences between 'Modbus TCP' and 'Modbus RTU over TCP'
I am building up a Modbus message to transmit over ethernet (PC as Master, PLC as Slave). Using http://www.simplymodbus.ca/TCP.htm as an easy to understand guide I have built up a request:
<pre>
-- MBAP Header ----------------------------
[Transaction ID] (2 bytes)
[Protocol ID] (2 bytes)
[Message Length] (2 bytes)
[Unit ID] (1 byte)
-- PDU ------------------------------------
[Function Code] (1 byte)
[1st Register Address] (2 bytes)
[Total Number of Registers] (2 bytes)
-------------------------------------------
</pre>
(The message has been built up as an array of bytes using hex values).
The array of bytes is send on an open socket connection using CAsyncsocket::Send (C++, MFC).
I believed that this is Modbus RTU over TCP. Is that correct? It's just the page I linked to above seems to refer to this structure as Modbus TCP.
I understand that there are protocol specifications available but after reading them, I am confused. Which is why I am hoping someone here could give me a simple explanation
Also, are there any advantages to using one version rather than the other? I am interfacing to the standard ethernet port on the front of an M340 PLC Processor.
Thanks
I am building up a Modbus message to transmit over ethernet (PC as Master, PLC as Slave). Using http://www.simplymodbus.ca/TCP.htm as an easy to understand guide I have built up a request:
<pre>
-- MBAP Header ----------------------------
[Transaction ID] (2 bytes)
[Protocol ID] (2 bytes)
[Message Length] (2 bytes)
[Unit ID] (1 byte)
-- PDU ------------------------------------
[Function Code] (1 byte)
[1st Register Address] (2 bytes)
[Total Number of Registers] (2 bytes)
-------------------------------------------
</pre>
(The message has been built up as an array of bytes using hex values).
The array of bytes is send on an open socket connection using CAsyncsocket::Send (C++, MFC).
I believed that this is Modbus RTU over TCP. Is that correct? It's just the page I linked to above seems to refer to this structure as Modbus TCP.
I understand that there are protocol specifications available but after reading them, I am confused. Which is why I am hoping someone here could give me a simple explanation
Also, are there any advantages to using one version rather than the other? I am interfacing to the standard ethernet port on the front of an M340 PLC Processor.
Thanks