D
Don Y
On Fri, 20 Sep 2013 11:00:18 -0700 (PDT), Klaus Kragelund
The real issue for ethernet to serial converters is how to split the
serial stream to Ethernet packets. The naive approach would be to send
one Ethernet package for each serial character, which is of course
totally unacceptable.
In practice, you haver to assemble several characters to a frame and
send a frame when the frame is full or the last character has been
received. Some old converters waited more than 10 ms with no more
serial characters, before sending the last Ethernet frame.
The Modbus protocol includes provisions for encapsulating a
modbus message in an ethernet frame. The gateway just
peels off the ethernet framing, then "interprets" the
modbus message contained within -- and pushes it onto the
wire (the gateway typically being a modbus master).
If the converter understands something about the serial frame, such
knows what is the terminating character in the frame and then send the
last Ethernet frame.
Serial Modbus RTU separates frames with an idle period at least 3.5
character times long, so that is the delay before sending the Ethernet
frame. However, an idle period longer than 1.5 character times is
illegal in Modbus, so you should wait at least that period of time,
before sending the Ethernet frame. The upper level CRC check would
then reject this frame, if such gaps exists within a message.
My experience with reasonable serial speeds (115k2 and below), modern
eth/serial converters send that last frame quite rapidly and any
internal processing delays within the gateway or Eth switches are
small, compared to serial character times (100us@115k2) at reasonable
serial speeds.
Modbus is much slower than a typical ethernet. So, there is a
potential for the gateway to be overdriven by ethernet packets
intended for the modbus network (unless you drive it synchronously).