I fixed a few bugs in the new RTU encapsulated hack code, if anyone is interested, I can upload the progress later.
The issue was around the MBAP header not being present in the return RTU packet.Testing is still going on. I had to create a fake MODBUS MBAP header transaction identifier to pass on to the following packet processing. I will test the write holding register function next. Read holding registers seems to be working fine now.
Parsing the packet down by type casting of the different structures took me a while to figure out. Once you lay the structures side by side it becomes obvious.