Connecting to a WAGO Controller via Modbus (TCP)

Hardware

Requirements for the WAGO controller

Requirements for CODESYS

Scan the network and select the device.

Settings on the Ethernet adapter

Define the network interface to be used.

If a target system is not defined yet, then the error message "Gateway not configured" is displayed.


Settings on Modbus_TCP_Master

Activate the automatic establishment of a connection after interruption.

Settings on Modbus_TCP_Slave

Specify the IP address of the WAGO controller and leave the Unit ID blank.
For Modbus via TCP/IP, the slave is identified by means of the IP address.



Create a channel for reading the input adapter:



Create a channel for switching the contacts of the output adapter:





So that the Modbus addresses are updated even without variable mapping, you have to activate this explicitly:

Download the project to the controller and start it