-3
\$\begingroup\$

Software address means a number saved in the flash memory(saved permanently).

Hardware address means that the number is determined by reading the state (high or low) of some pins.

Is there any difference between them? which is the most robust solution for industrial application?

\$\endgroup\$
8
  • 7
    \$\begingroup\$ RS-485 is a physical and data link layer standard so your question doesn't make any sense. It doesn't have addresses. \$\endgroup\$
    – Lundin
    yesterday
  • \$\begingroup\$ i wanna communicate multiple device... \$\endgroup\$ yesterday
  • \$\begingroup\$ Then you need an application layer protocol on top of RS-485. Something like Profibus or Modbus. Or in case you don't want to use dinosaur technologies, switch to CAN bus. \$\endgroup\$
    – Lundin
    yesterday
  • \$\begingroup\$ There is no such thing for RS-485... Modbus maybe? \$\endgroup\$
    – Ron Beyer
    yesterday
  • \$\begingroup\$ What you are referring to isn't an RS485 thing. It's just a generic way to assign a microcontroller some ID number (or any number) that can be used for any purpose. RS485 does not inherently have addressing anyways. You need to make it support addresses iif you want them. \$\endgroup\$
    – DKNguyen
    yesterday
-1
\$\begingroup\$

There are actualy three options could be defined. The names below aren't an industry standard, but just a way to refer different approaches.

Software address is an address saved in a flash memory (or other reprogrammable memory), but not permanently. It can be changed via some special means, like configuration command on the same interface or using some technological tool.

It is most flexible approach and often used when number of devices in the network is uknown. This approach usualy implies ability to change all the address bits. And it is somewhat more difficult to end-user than hardware addressing, because changing of an address requires knowledge of an old one if device has no UI (some screen, buttons, etc)

Hardcoded address is an address, that can't be changed without doing permanent modification of the device - flashing other firmware, resoldering bridges, etc. Devices with hardcoded addresses usualy have this address specified in documentation. Sometimes the manufacturer allows address to be specified in the order, but still doesn't allow the end-user to change it.

This is a good choise for mass-production or designing a device for a specific use. The end-user just knows the address, and designs his higher level system based on this knowledge. Devices can be easily replaced in case of mailfunction without any prior configuration.

Hardware address can be changed with some mechanical manupulation by end-user. It could be jumpers, swithes, even connection of some pins on the cable (connection-defined address), if it is designed by end-user.

Usualy limited to just several address variants. If it is known, that no more than four devices of the same type could be on the network, then two modifiable bits is enough. The end-user can place devices on targel locations (if it is sensors, or some remote terminals) and set their addresses.

Sum

Choosing the address selection method is very application dependend, sometimes any can be used, yet sometimes analyzing the target application leaves just one possible variant.

When using hardware/software address it is a good thing to implement address validation, e.g. add an extra bits for parity chekcing. In case of incorrect address device should not respond at all to prevent breaking the network.

Of cource all above doesn't limited to RS485, most interfaces use addressing, and an address has to be set somehow.

\$\endgroup\$
-2
\$\begingroup\$

You need to assign each device a link layer unique address, for example an integer number.

Keep into account a provisioning phase. That is, you have to manually assign that unique address to all of the devices in the network.

You can also design your link layer protocol in a way that each devices auto assign itself a random address of at least 32 bits in order not have collisions.

\$\endgroup\$
3
  • \$\begingroup\$ I didn't DV, but using "random addresses to avoid collision" is like not using a seatbelt because, statistically, you won't get into an accident today. \$\endgroup\$
    – Ron Beyer
    yesterday
  • \$\begingroup\$ Many microcontrollers comes with a 96-bit unique ID. You might use that one as a MAC address. \$\endgroup\$ yesterday
  • \$\begingroup\$ Assuming the link-layer supports 96-bit addresses. For example, Modbus only supports up to 247 addresses... \$\endgroup\$
    – Ron Beyer
    yesterday

Not the answer you're looking for? Browse other questions tagged or ask your own question.