Skip to main content

Configuring Modbus Devices

Configuring the ModbusTCPServerSideExample project

  1. Double-click the editor of the Ethernet node to open it.

  2. 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.

  3. Open the editor of the Modbus TCP Server Device node.

  4. Adjust any settings on the General tab if necessary. This example uses the default settings only.

  5. 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

  1. Double-click the editor of the Ethernet node to open it.

  2. 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.

  3. Open the editor of the Client node and adjust any settings if necessary on the General tab.

  4. Open the editor of the Server node below the Client node.

  5. Set the Server IP address to the address you used for the Ethernet node of the ModbusTCPServerSideExample.

  6. Open the Channels tab and click the Add button.

  7. In the Add Channel dialog, specify the following values:

    Field

    Value

    Name

    Channel 1

    Access Type

    Write Single Register (Function Code 6)

    Trigger

    Cyclic

    Cycletime

    100

    Writing Offset

    0

    Comment

    Write command

    All other inputs remain disabled or are not required.

  8. Click OK to confirm the dialog.

    The channel will now be visible in the channel list.

  9. Click the Add button to add another channel.

  10. In the Add Channel dialog, specify the following values:

    Field

    Value

    Name

    ChannelĀ 2

    Access Type

    Read Holding Registers (Function Code 3)

    Trigger

    Cyclic

    Cycletime

    100

    Read Offset

    0

    Read Length

    1

    Error Handling

    Keep last value

    Comment

    Read command

    All other inputs remain disabled or are not required.

  11. Click OK to confirm the dialog.

    The channel will now be visible below the first channel in the channel list.