I'm using the ModbusMaster.h library on a project, with arduino-uno and a TTL/RS-485 converter, and the function has to identify the slave that it is communicating. The slaves goes from 1 to 16. After I've begun the connection,
ModbusMaster node(1);
node.begin(9600);
I have to send a message, and if this massage returns an error, I have to change the slave number, until I got an valid answer. But I didn't find any functions to close this connection, or to delete it, I even have tried,
delete &node;
but it didn't work. I'm trying to close this connection so I could begin another one with another node, because I didn't find a function to change the slave number.