The main characteristic of a MODBUS slave is its identifier, which is used to address the requests to the desired device. That is the reason why it is the first parameter to define when adding a MODBUS slave in a ModbusPal project.
But it is not sufficient. A MODBUS slave exchanges information with the MODBUS master. This information is organized in registers and coils. Then, once the slave is created with an identifier, its content must be defined.
This section covers the basics of creating a MODBUS slave in ModbusPal.
Addbutton lets the user create new MODBUS slaves
Enable allbutton selects all the MODBUS slaves and enables them
Disable allbutton disables all the MODBUS slaves
Click on the Add
button in the MODBUS Slaves panel in order to
add new MODBUS slaves.
A dialog appears. Select the MODBUS slave address of each new MODBUS slave to create. Multiple addresses can be selected from the list by holding the SHIFT key and/or the CTRL keys.
The name of the new MODBUS slave(s) can also be edited before actually creating them. ModbusPal doesn't care if several MODBUS slaves have the same name. Specifying a name can help to explicit the role of the new slave in the project.
Finally, click on the Add
from the dialog in order to validate.
The MODBUS slave(s) is(are) inserted into the list of the MODBUS Slaves
panel.
When added to the list, a MODBUS slave looks like this:
While the project is running, it can be useful to disable MODBUS slaves for testing purpose. Once a slave has been disabled, any incoming request addressed to that slave will end up in a MODBUS exception response.
A MODBUS slave is disabled by toggling the
button.
A freshly created MODBUS slave contains no data. Registers, coils
and so on can be defined in the slave’s configuration dialog, which
becomes visible when the
button is toggled.
The instructions for configuring the MODBUS slave can be found in this page.
After spending a lot of time configuring one MODBUS slave,
new MODBUS slaves can be created on the same model simply by clicking
on the
button.
A dialog appears, very similar to the
Add
dialog described above. One or multiple slaves can
be created; each of them will be an exact copy of the original slave.
Click on the
button of one MODBUS slave in MODBUS Slaves panel to remove it from the
current project.