Why not keeping modbus as protocol family, encoding as option with
transport as part of URI?
Full uri would look like modbus:<encoding>:<transport>.
Then defaults could be:
modbus:serial:/ => rtu, same as modbus:rtu:serial:/
modbus:ascii:serial:/ => ascii over serial
modbus:tcp:/ => tcp
modbus:rtu:tcp:/ => rtu traffic tunneled over TCP socket
I know we have generated drivers but clearly we have a whole bunch of
logic which is same no matter which encoding and transport is being
used. Isn't it?
We probably need to adjust driver base for that, but that's possible
with work we made with custom protocol stack which was needed for CAN.
Above way keeps us away from making a separate variant of driver for
each case as long as protocol logic is same across them. I didn't look
at implementations so I don't know if there are major differences
between rtu over tcp and rtu itself, but that's other thing.
Best,
Łukasz
On 9.03.2022 19:29, Ben Hutcheson wrote:
-0
Having an alias for modbus-tcp as modbus would probably be good practice,
but hey if no one complains then go for it.
Currently the modbus-tcp also supports udp, it would look funny as
modbus-tcp:udp
I haven't actually seen it over udp but apparently they're out there.
Modbus+ should definitely be ignored. It is a proprietary protocol by
Schneider which uses it's own ASIC.
The Quantum PLC platform, I believe were the last ones that had it by
default, it also wasn't commonly used for most installations.
Ben
On Thu, Mar 10, 2022 at 3:13 AM Niclas Hedhman <[email protected]> wrote:
On 2022-03-09 17:07, Christofer Dutz wrote:
Hi Lukas,
I think that Modbus+ is a completely different thing. Seems to be
related to routing of Modbus traffic ... haven't looked too deep at
it.
I think it was an attempt to modernize Modbus for the 21st century, but
I have not seen any devices on the field with it. I suggest it can be
ignored.
From the Spec side there are 3 variants:
- Modbus TCP
- Modbus RTU
- Modbus ASCII
Yes, that is the norm. Sometimes written Modbus/RTU or Modbus/TCP.
In general Modbus RTU and ASCII are sort of the same (Serial) ... the
main difference is the encoding of the payload and the termination of
frames. That's why I'll leave the ModbusSerialAdu as topmost packet in
both Modbus RTU and ASCII, as the difference is handled on the level
between the transport and the driver.
Practically all Modbus devices on RS-485 supports RTU, and a huge number
of them supports ASCII as well. But the only times I have seen Modbus
ASCII used, is long ago (1980s ?) with hand terminals where astute
operators entered the arbitrary packets by hand. Landis&Gyr followed
that "fashion" and also had a line-by-line, near-human operatable,
protocol format (with CRC for computers, and without CRC if typed by
hand).
That skill slowly disappeared as hand terminals and/or troubleshooting
software became more sophisticated and hid such low-level stuff and
typically just run RTU mode. I doubt anyone would truly miss ASCII if it
is not available. OTOH, basically just encoding difference.
Please correct me if I'm wrong,
You got it right.
Niclas