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.

No clue what you're writing about. What MUX? As it seems to have DIP switches it must be some kind of hardware. As you failed to provide a link to that hardware we cannot help.

Hey Pylon,

Can you share me the code which has DIP switch slave configurable settings , and mux hardware connections?

Your help will be blessing gift to me.

No, you still failed to provide necessary information about the hardware you're using.
I already posted for the ModbusRTU.h library to change the slave ID. Maybe that works for, otherwise provide the information we asked for!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.