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...