Search code examples
c#modbus

Is there any option to change my device slave ID using MODBUS protocol?


I am a new user at MODBUS protocol. I saw Modbus slave address register has capable to read and write. When I prepare a message to communicate with any device (via Com port) through Modbus protocol must need a slave address. Please check this out for all of the Modbus function request and response https://www.simplymodbus.ca/FC01.htm).

My questions are, Is it possible to change the slave address? If yes, What about the message format? (like, currently my device slave address has 1, I would like to change my device slave address is 2)

Sorry for my bad English and thanks in advance.


Solution

  • So the question is (as you wrote on the comments above): is it possible to change the slave ID of this particular sensor (Calex PyroMiniUSB)?

    And the answer is: yes, it is. On page 7 of the manual you can see the complete Modbus map of the sensor. Adddress 0x04 is the slave ID and it's marked as R/W, meaning that you can write to it.

    To do that just connect to the sensor on the default ID 1 with the Modbus polling client you linked on your comments, write a 4 on box register and the new ID you want to use on the bottom left part of the GUI and click write.

    After you do that you should be able to connect on the new slave ID, but you might new to power cycle the sensor (switch off and on again) for the need ID to take effect.

    You can, of course, do the same thing with code, which is, I guess what you mean by programmatically.