...
- Create a "Standard project" and select CODESYS Control Win V3 as the device.
- Define the target system by means of the Netzwork scan.
Insert an Ethernet adapter in the device tree and specify the interface to be used.
Note If a target system is not defined yet, then the error message "Gateway not configured" is displayed.
Insert a Modbus TCP Master below the Ethernet adapter in the device tree.
Insert a Modbus TCP Slave below the Modbus TCP Master in the device tree.
Insert it in the Modbus Slave Channel tab and set the properties as follows:
Adapt the POU PLC_PRG as follows:
Section Column width 7 Declaration
Column width 93 Code Block theme Confluence VAR xExec : BOOL; wMasterSend : WORD := 100; mbChannel : ModbusChannel; END_VAR
Section Column width 7 ImplementierungImplementation
Column width 93 Code Block theme Confluence mbChannel(slave := Modbus_TCP_Slave, xExecute := xExec);
...