FluentModbus
FluentModbus copied to clipboard
About Message Receive
In Slave mode of the library, I can't seem to find a place to receive messages from the Master. For example, if the Master sends a request message with 03 function code, where can I receive it? I also want to be able to determine what function code the Master is requesting and what data it is receiving
That's a valid question. You can control the response of the server using a validator function:
https://github.com/Apollo3zehn/FluentModbus/blob/master/doc/samples/modbus_validator.md/
However, there is no direct way to set the response data. You can only manipulate the server.GetHoldingRegisters()
array (for example) from within the frame validation routine.