Ethernet / Modbus TCP

Hello, I use the MODBUS library #include <ArduinoModbus.h>, to request data from the slave.

I receive an answer but not the expected one.
To debug, I want to start checking the sent frame after sending the calling the following instruction
modbusTCPClient.requestFrom(INPUT_REGISTERS, REG_AD_CHANNEL_1,2)

Is the a function which can be used to double check the last sending frame ?

Well, I had to do with Modbus/TCP on other architectures (C#) in the past, but I never needed to check sent frames, so the question could be: what response you're expecting and what you get then? What is the device you're sending requests?
To make sure about that, use any ModbusTCP application (I don't remember which one I used a few years ago, but ModbusTCPTool might be a good fit for you) to send requests and responses you get, for an easily test communications.

PS: and are you sure you need to read an input register instead of others? Some devices I had to do with returned the reading values via Holding register for example... It seems to depend on the device and its implementation charts...

Hi, My problem came from the address register. In the specification it says to read at address 1001 for the LSB and 1002 for the MSB. But -1 is needed to be applied. So LSB at 1000 and MSB at 1001. In decimal and not in hexa.

Thank you