My box does not act as a modbus slave, I use the library to scan devices connected to the serial line only (it a master)
But other services in the network may want to read some devices information and my box is in the middle, so I need to:
1 Act as slave in the LAN port to read an generic request (any command, any node, etc),
2 Remove the modbus/tcp header (save it for later use), redirect the function. node, payload and CRC to the serial port
3 Wait for the reply
4 Add the original modbus/tcp header received in 2 to the serial, and send back the reply to the system in the LAN port.
What I'm looking for is a function to perform the action in 4
May be expose the send function to the user?
Thanks and best regards
Carlos