I have tried to modify the test code that the "#include <ModbusMaster.h>" library has to make my device work but I have not been successful, reading the documentation I think my main problem is that I am not choosing the correct register for the reading and writing, I have already tried various combinations but have not been successful, maybe it is because I am new to using Modbus, maybe someone with more experience can help me with some suggestion, I would greatly appreciate all your respects, my current code is as follows:
I understand that this part initializes my serial port for Modbus communication but this should not be enough to establish a link with my sensor?
In the same way, this process should be executed correctly if the Modbus communication is already initialized or I need something else?
I have been guided by the following code as a reference:
Did you read the rest of my post? Sure, it establishes the communication but you ruin it afterwards by writing to the same interface. Your Modbus device won't recognize your debugging strings and mark the complete protocol as failed.
No this code is executed only if the transmission was correct. It cannot be correct because you interrupted the protocol by writing stuff as above "Result: " to the Modbus interface.