Configuring Modbus Devices
Configuring the ModbusTCPServerSideExample project
Double-click the editor of the Ethernet node to open it.
On the General tab, adjust the settings to match the hardware being used.
Tip
The network interface must fully match the hardware being used in order to prevent connection problems. The Modbus TCP Server Device uses the IP address configured in this Ethernet node.
The name of the network interface must also match the hardware being used.
Open the editor of the Modbus TCP Server Device node.
Adjust any settings on the General tab if necessary. This example uses the default settings only.
Open the I/O Mapping tab.
The registers and discrete bit areas matching the configuration on the General tab will now be available.
Configuring the ModbusTCPClientSideExample project
Double-click the editor of the Ethernet node to open it.
On the General tab, adjust the settings to match the hardware being used.
Tip
The network interface must fully match the hardware being used in order to prevent connection problems.
The name of the network interface must also match the hardware being used.
Open the editor of the Client node and adjust any settings if necessary on the General tab.
Open the editor of the Server node below the Client node.
Set the Server IP address to the address you used for the Ethernet node of the
ModbusTCPServerSideExample.Open the Channels tab and click the Add button.
In the Add Channel dialog, specify the following values:
Field
Value
Name
Channel 1Access Type
Write Single Register (Function Code 6)
Trigger
Cyclic
Cycletime
100Writing Offset
0Comment
Write commandAll other inputs remain disabled or are not required.
Click OK to confirm the dialog.
The channel will now be visible in the channel list.
Click the Add button to add another channel.
In the Add Channel dialog, specify the following values:
Field
Value
Name
ChannelĀ 2Access Type
Read Holding Registers (Function Code 3)
Trigger
Cyclic
Cycletime
100Read Offset
0Read Length
1Error Handling
Keep last value
Comment
Read commandAll other inputs remain disabled or are not required.
Click OK to confirm the dialog.
The channel will now be visible below the first channel in the channel list.