How is a MODBUS slave detected by the master

A

Thread Starter

arbj

I am trying to develop a MODBUS compliant device that will be a slave unit in a MODBUS network.

I have these basic queries...

1. Say I connect my slave unit to a MODBUS network, how will the MODBUS master (in my case a PLC) know the address of the slave unit. Is the address given to the slave dynamically by the master or is it set by the user during installation ??

2. When I take my slave unit for installation, does it need any GSD files (like in PROFIBUS) or any other configuration files ?? Are these files generated by the PLC ??

3. The slave unit is a automation controller, commands from the MODBUS master are sent to the slave unit that does the necessary motion control as dictated by the command.

So the command list for the slave unit will have to given to the user during installation of the system ?? How should this list be given as a specification file or as configuration file to be entered in a PLC ??

Sorry if these queries sound basic, but I am new to the area of PLC and I am curious to know how systems are setup in the industry.

thanks
a
 
L

Lynn August Linse

This thread will have some colorful answers. Best answer to your questions is NOTA (None Of The Above).

Modbus was born long before any of these ideas existed - in fact it was born when 4K of RAM was a huge resource. Modbus works because YOU manually do all the work, using your eyes to read paper documents and punching in numbers and codes to the Master. If you punch in the wrong codes, your master happily presents you with mis-applied garbage. This made the slave resource requirements very small.

While this seems ugly and backwards, it is part of Modbus's charm - and why it is still going strong. It takes very little work to create a Modbus Slave - a few days, or even hours.

In contrast, to use Rockwell's Ethernet/IP or Siemens PROFI lines, one needs to buy licenses, tool-kits and perhaps spend weeks or months learning a huge framework and 'how things are done'. The end result is more impressive and fool-proof, but there was a cost to it.
 
S
"While this seems ugly and backwards, it is part of Modbus's charm - and why it is still going strong. It takes very little work to create a Modbus Slave - a few days, or even hours."

By "ugly and backwards" I assume you mean "appropriate, proper and goof proof". ;-)

If the master is running the lists of requests that I programmed, rather than trying to figure out one on it's own, at least I know it's right.
 
> I am trying to develop a MODBUS compliant device that will be a slave unit in a MODBUS network.

Modbus/TCP or Modbus serial?

>I have these basic queries...

> 1. Say I connect my slave unit to a MODBUS network, how will the MODBUS master
> (in my case a PLC) know the address of the slave unit. Is the address given to the slave
> dynamically by the master or is it set by the user during installation ??

You have to provide every slave/node a unique identity. In the case of Modbus serial that identity is the slave address. You will also need some way to set the serial communication parameters. In the case of Modbus/TCP you have the same problem you have with any IP network. You can use static IP addresses or a DHCP/DNS server to provide the identities. In that case too, you need some way to tell the Modbus gadget what to do when it boots.

> 2. When I take my slave unit for installation, does it need any GSD files
> (like in PROFIBUS) or any other configuration files ?? Are these files
> generated by the PLC ??

The slave needs some information about how it should join the network. You have to put some software or dip switches (a lot of them) on the slave to make that happen.

> 3. The slave unit is a automation controller, commands from the MODBUS
> master are sent to the slave unit that
> does the necessary motion control as dictated by the command.

>So the command list for the slave unit will have to given to the user during
> installation of the system ?? How should this list be given as a specification
> file or as configuration file to be entered in a PLC ??

That's a documentation task. You have to supply the user with a memory map of the slave and describe what each memory location causes the slave to do or what the memory location reports back to the master.
 
C

curt wuollet

I strongly agree: Auto everything and magical stuff can be extremely difficult to troubleshoot when it isn't.

Regards
cww
 
thanks for the replies..

I intend to use MODBUS Serial - RTU for my application.

I now get the picture clearly..

The slave address and baud rate will be set using DIP switches.

The documentation will cover all the important coils, input registers used.

Is there any sample documentation that I could get ideas from ??

thanks
a
 
1) >baud rate by DIP switch:

What about the parity setting?

2) > Documentation will cover . . .

Be sure to explicitly define
- whether the register is read/write, or read only
- the data format: signed or unsigned integer, floating point (real), long integer, whatever.

3) Consider providing the data in multiple formats to make it easy to use. Put an integer in one register, put the same data in floating point in a different register.

4) If your hardware layer is RS-485, does it have a signal ground terminal?
 
>4) If your hardware layer is RS-485,
>does it have a signal ground terminal?

Yes the hardware layer is RS 485, 2 wire, A, B and a common ground.

thanks
a
 
Top