??? 04/05/12 23:05 Read: times |
#187018 - Changing the Modbus Address Responding to: ???'s previous message |
Murray
Murray R. Van Luyn said:
Ah, that's got me interested. No mention of dynamic address assignment in any of the sources I've so far briefly surveyed. Any clues, product manuals or info links describing how that works would be just the ticket. Such a scheme may obviate the necessity to individually configure slaves, either at commissioning, or during in-service failure replacement. I did a series of articles for Circuit Cellar on creating a Modbus Master (March & April 2007) and Modbus Slave (July 2008). The slave was developed on a PSoC, but is almost all in C so it shouldn't be too difficult to follow. (Circuit Cellar's business model is to charge a minimal amount for each article, although the code is available for free.) You may find the articles informative on how Modbus memory can be partitioned. For your purposes I suggest a register for the Modbus-address at a register address physically separate from the other register addresses (to prevent multi register instructions acting on dissimilar memories). You will need to provide different routines depending on which Modbus register type is being accessed. Associate the the Modbus-address register to a Flash/EEPROM location and when the address is written, you can change the Modbus-address to the new value. Of course you can put safety measures like write-enable bits in some other register. Modbus has a facilty to respond with an acknowledge, and then go away and execute some action that can take some time (like updating the EEPROM). I don't have the details at the moment (I am at home, and this is a long weekend), but if you let me know I will look up the sequence on Monday. -Aubrey |
Topic | Author | Date |
Data Link Layer for RS485? | 01/01/70 00:00 | |
Modbus | 01/01/70 00:00 | |
Yep, Modbus Fits The Bill. | 01/01/70 00:00 | |
Changing the Modbus Address | 01/01/70 00:00 | |
You've been busy. | 01/01/70 00:00 |