Just looking at implementing Modbus RTU and have a couple of options around it's structure, that I wanted to get opinions on.
The protocol uses two main data structures, an ADU and a PDU. The PDU is the main part of modbus and has all the function codes and data included in it. This is the same for modbus tcp and rtu. The ADU wraps the PDU to provide additional data such as address and CRC fields. RTU is very similar to modbus TCP with only the ADU format changing that wraps the PDU. As it is very similar it could be possible to reuse the existing mspec with the addition of an RTU ADU. And then use this ADU in the RTU protocol logic. The protocol logic I think is going to be different enough to warrant an entirely new version as opposed to implementing switches in the current logic, which I think could get confusing very quickly. It also has the added benefit of allowing odd specs like Modbus RTU over TCP trivially. The protocol identifier I'm looking at using is modbus-rtu. I dislike it as the original modbus tcp one is just modbus and not modbus-tcp. But figured it's the better option. Ben
