[En-Nut-Discussion] Industrial interfaces (Modbus TCP, Profinet, etc.)
phip at hb9etc.ch
Wed Jul 16 21:36:24 CEST 2014
I've just had a look at some of the Modbus docs. Seems like this indeed
is almost trivial to implement... What I'm unsure about, however, is the
fact that the protocol uses a packet-based approach over a stream
oriented channel (TCP). As long as the messages are short and have a
substantial amount of time between them, this should be no problem. The
socket will just happily pass every message up to the application as a
single unit. But what happens if multiple messages end up in a single
frame and, hence, are passed to the application in a single read
operation? Or, even worse, if a message gets split into different reads?
It can be solved with a statemachine on the receiver side as long as
there is not a single error in any of the packets, but what if the
client sends bogus data for any reason? I don't see a way for the server
to ever resynchronize (or detect the mismatch at least) unless the
client terminates and reestablishes the connection. Am I overlooking
something, or is it really that simple? Wouldn't look too robust to me...
On 16.07.2014 20:55, JP Merle wrote:
> I've made a program in order to drive a motor using modbus tcp. It was not for industrial purpose, but only for demonstration of CIM concept in a school. I had no original code, so I had to write my own
> Sent from my iPhone
>> On Jul 16, 2014, at 8:31 PM, Philipp Burch <phip at hb9etc.ch> wrote:
>> Hi everyone,
>> I'd like to ask if anyone of you has experience with integrating
>> Ethernut-driven devices in industrial networks based on Ethernet.
>> Sometime in the near future, we will need to implement some standardized
>> industrial interface in one of our devices, such as Modbus TCP or
>> Profinet. Does someone already have such code at hand by chance? I'm not
>> concerned about Modbus TCP, this should be fairly simple to implement.
>> But as far as I understand Profinet, this works below the transport
>> layer, i.e. it does not (only) use TCP or UDP, but something different.
>> Or are there other popular interfaces that could be a good choice? We do
>> have an FPGA on that device, but I'd prefer to do the network stuff only
>> in the microcontroller, so EtherCAT is not really an option.
>> Thank you!
>> Best regards,
More information about the En-Nut-Discussion