Connecting Controller (Master) to Controller (Slave)
The basic procedure largely corresponds to the description in Connecting Controller (Master) to Fieldbus Coupler (Slave). The main difference is the assignment of the direction of communication. This is not assigned automatically, since programmable devices can perform both master and slave functions. Thus the roles must be set. Furthermore, the data points of programmable slave devices must be created and configured for the communication.
Place Devices on the Communication View
- Select the controllers from the product catalog and use the mouse to drag them into the Network view (communication view).

Configure I/O Modules Used in the Device Detail View
- Open the Device Detail view (in either graphical and tabular view) by double-clicking the controller.
- Arrange the I/O modules used analogously to your hardware by dragging them from the product catalog and positioning them after the device.
- Parameterize the I/O modules as needed by selecting them and making changes on the “Settings” panel for each.
- Go back to the Network view.
- Proceed in the same way with the second device.
Connect Devices
First consider which device should serve as the master and which as the slave, since the order in which you connect the devices to each other is relevant to the device roles. The connection line starts at the master and ends at the slave.
- Click the gray connector (ETHERNET/Modbus) of the Master in the Network view (communication view) and hold down the mouse button.
- Drag the connection onto the connector of the Slave of the same type and release the mouse button as soon as a green plus symbol appears.
- The devices are connected. The arrow of the connection line indicates the device roles you have assigned: The connection line starts at the master and ends at the slave.

Tip: You can change the master and slave device roles later as needed. Click the Modbus connector of one of the two devices and then click [Communication Relationship]. The current communication relationship is highlighted in blue and displayed first. If necessary, select another entry.

Set the Protocol for the Connection
- To set the protocol for the connection, click the [Protocol] button in the context menu of the Modbus connector or connection.
- Select the desired connection (in this example: “Modbus (TCP)”).

The selection options depend on the devices used.
Make the Device Settings on the “Settings” Panel
You can change the settings or parameters of the devices that have been added on the “Settings” panel. The panel is open by default. If it is not, open it using the context menu of the device and the [Settings] button.

- Select the device in the network view.
- The tabs, entry screens and selection fields on the “Settings” panel depend on the specific device. The settings options displayed depend on the content of the particular device description file.
- Make all the general settings concerning the device, PLC and local bus on the first tabs. For example, you can change the IP address.
- Make Modbus settings on the “Modbus” tab.
- Proceed in the same way with the second device.
Program Application
- Select the controller (master).
- Open the “Program Structure” panel by clicking the [Program Structure] button on the “VIEW” tab of the menu ribbon.
- Create your program (in the main “PLC_PRG” program or in a POU).
- Compile and validate your program on the “PROGRAM” tab with [Compile].
Configure Slave
You configure the slave in the data point configurator.
- To switch to the data point configurator, double-click the Device tile of the slave device.
- The Device Detail view appears. The Modbus data point configurator opens on the “Modbus Slave” tab of the Device Detail view.
- Now specify which data points the slave should make available via the fieldbus. The following options are available and are explained below:
• Use existing variables from the application
• Use variables from I/O modules
• Create generic data points
Use Existing Variables from the Application:
Since a programmable device is used as a slave in this case, the slave’s data points consist of variables of the slave application, among other things. These can be selected and created directly from the application.
- In the “Program variables” context menu, click [Add from Program].
- Select an existing variable from the slave’s application.
- Note: Simple data types are transferred directly via Modbus, while complex data types (including structures) are mapped to word arrays. These are then transferred via Modbus instead. If the data type used is known globally in the project, the master can directly access the individual elements of the complex variables, although Modbus does not use such a data type itself (see also Access to Simple and Complex Data Types).
- Transfer this with [OK].
- Select the direction of communication (Input, Output or Input / Output).
- You can use the new data point.
Use Variables from I/O Modules:
- In order to use variables from I/O modules of your application, first switch to the “Local Bus I/O Mapping” tab in the data point configurator.
- In the Device Detail view, select the I/O module whose variables you want to access.
- Create variables for the individual channels of the I/O modules (here “var1” and “var2”).
- These variables are available globally.
- Switch back to the data point configurator by clicking on the controller and then on the “Modbus Slave” tab.
- In the “Program variables” context menu, click [Add].
- A new data point, “ModbusDataPoint,” is created.
- Switch to the slave’s application and assign the local bus variable of the I/O module to the data point that was created.

Note
Always map variables of I/O modules via newly created data points!
For variables of I/O modules, use the [Add] button (as described above), not [Add from Program].
Although you can also select the variable with [Add from Project] (the variable is shown under “Program variables”), this method does not allow access, since the variable is already accessed via the local bus. .
When you click [Generate Code], a corresponding message is output in the message window: var1: map to existing variable with address is not allowed!
Therefore, only use [Add from Program] for application variables, not for variables of I/O modules.
Create Generic Data Points:
There are applications in which it makes sense to use generic data points. For example, you can group multiple data points into one register. You can then access them from different masters without having to create manual channels for every access point in the master.
- To create new generic data points, click [Add] in the context menu of “Generic Data Points.”
- If necessary, change the data type and Modbus address.
- In the context menu of the variable, click [Edit] and, if necessary, modify further settings, such as function code settings.
Note: Generic data points are not available via the slave application.
Configure Connection between Master and Slaves
You can configure the connection between the master and slaves in the fieldbus configurator. Here you primarily make connection settings, display variables to transfer and create new variables.
- Click the Modbus connector of one of the two connected devices.
- Open the Modbus fieldbus configurator by clicking the [Configurator] button.
- The fieldbus configurator opens. The connection is shown in the header section of the configurator. If multiple slaves are connected to one master, you can modify the selection under “Selected Connection.”
- The fieldbus configurator is divided into two columns:
The left side shows the variables that are transferred from the slave to the master via the bus.
The right side shows the data points available on the slave. Besides “Program variables,” “Generic Data Points” and other standard variables that are automatically available to every Modbus slave (“WAGO Modbus special register”) are also shown here. - In the right-hand column, select a slave data for the master to access.
Tip: You can select multiple data points by holding down the Control key. - Click [Map] in the context menu of the data point.
- The variable is generated in the master application. This establishes the connection to the slave data point.
- You see the slave data point (1), the variable that has been created on the master (2), the drop-down list for modifying the data type (3), the cycle time for updating variables via Modbus and (4) the type of Modbus access to the variables (5).
ReadOnly (RO): Master reads the slave’s output
WriteOnly (WO): Master writes to the slave’s output
ReadWrite (RW): Master reads the output/writes to the input of the slave - Change the cycle time (column T [ms]) to the required cycle time.
- You can now use the master variable in the master’s application.
Access Data Points
- Open the program structure and the main program of the master.
- In the master’s application, the variable is accessed as shown in the following figure.
- Tip: Press the [F2] key to open the input assistant for easy variable selection.
- In this way, an existing slave data point has been made accessible via Modbus and read out in the master application.