ModbusRTU.h Slave ID Set with DIP Switch Code Assitant needed or please anyone suggest a library that support physical or software slave ID change

Code Assitant needed or please anyone suggest a library that support physical or software slave ID change For MODBUS .
Anyone who already built is appreciated.
Thank you

There is a setID() method for exactly that purpose.

How to use that Function i dont understand tried all things but no result.
Can you provide me any example?

You provide the new address as a parameter to the method.

uint8_t new_id = 8;
slave.setID(new_id);

where slave is the initialized ModbusRTU object.

I don't understand where you see a problem. Maybe you should explain what you don't understand.

Hey Pylon

I am very new to Arduino Programming i do understand whole modbus but i don't understand the mux DIP switch to change slave ID if you provide any snippet how it should be declared .

Only Changing the slave ID part i don't understand with MUX.