Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Aubrey Kagan
04/05/12 17:05
Read: 698 times
Markham
Canada


 
#187018 - Changing the Modbus Address
Responding to: Murray R. Van Luyn'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

List of 5 messages in thread
TopicAuthorDate
Data Link Layer for RS485?      Murray R. Van Luyn      04/05/12 11:37      
   Modbus      Aubrey Kagan      04/05/12 13:13      
      Yep, Modbus Fits The Bill.      Murray R. Van Luyn      04/05/12 14:49      
         Changing the Modbus Address      Aubrey Kagan      04/05/12 17:05      
            You've been busy.      Murray R. Van Luyn      04/06/12 12:04      

Back to Subject List