Remote I/O module 16 DI
AL4042
39
9.3 ModbusTCP
9.3.1 Integrating a device into a Modbus TCP project
The device offers the functionality of a Modbus TCP server (independent mode). The user can
integrate the device into a Modbus TCP project via the profile of a generic Modbus TCP slave.
The device can be configured via the Modbus registers.
9.3.1.1 Example: Integrating a device into a CODESYS project
u
Familiarise yourself with the Modbus Configurator function in the CODESYS help.
Task: Integrate the device into a CODESYS project.
Available hardware:
•
SmartPLC AC14 DL (Modbus TCP Master)
•
Device AL4042(Modbus TCP Slave)
Solution:
Create a Modbus TCP master
Requirements:
ü
CODESYS project with AC14 DL was created.
u
In the device tree: Right click on the node [X8 (Ethernet)].
w
The context menu appears.
u
Select the menu item [Add device…].
w
A dialogue window appears.
u
Select the device profile [Modbus_TCP_Master].
u
Click on [Add device].
w
CODESYS adds the Modbus TCP master as a sub-node of the interface [X8 (Ethernet)] to the
project.
w
SmartPLC AC14 DL can be configured as TCP Master mode.
Add the device as a Modbus TCP slave
u
In the device tree: Right click on the node [X8 (Ethernet)] > [Modbus_TCP_Master].
w
The context menu appears.
u
Select the menu item [Add device…].
w
A dialogue window appears.
u
Select the device profile [Modbus_TCP_Slave].
u
Enter AL4042 as the name.
u
Click on [Add device].
w
CODESYS adds the device to the project as a sub-node of [Modbus TCP Master].
w
The device can be configured as a Modbus TCP slave.