Topic: P330

Modbus Device and Productivity CPU Modbus Device Configuration

Description

Modbus is a common protocol for industrial communication. Modbus TCP uses Ethernet as a transport layer, while Modbus RTU primarily uses RS-485, though it can support other serial modes. Productivity supports both Modbus TCP and Modbus RTU. Next-generation Productivity CPUs (P2-622 and newer) support dynamic addressing for Modbus communications, using Modbus Devices.


To configure a Modbus Device, use the setup tools found in the Hardware Configuration window. Two device options are available, with different purposes. The Generic Modbus Device is used for any Modbus TCP/RTU device and creates an addressable device for use with theMBUS instruction. The MBUS instruction is similar to the MRX and MWX instructions, but allows for program control of transaction parameters, so instructions can be easily reused. The Productivity PLC CPU option is used for communicating tag values directly between Productivity CPUs using the new NETW instruction, and is most similar to the existing RX and WX instructions.


Select the Modbus Device type desired for the project and double-click or drag and drop to add to the project configuration.


Generic Modbus Device Configuration

  1. Device Name: Each Generic Device added to the Modbus window must contain a unique Device Name that can be selected in the Modbus (MBUS) instruction.
  2. Ethernet: Select this option if Modbus TCP is to be used for this device.
  3. Target IP Address: If Ethernet is selected, this is where the IP address of the target Modbus device is entered. A string tag can also be selected here if changing the target IP address is required within the program.
  4. TCP Port Number: If Ethernet is selected, enter the Modbus Server port number of the Target device. Typically, this value will need to be 502 as this is the registered TCP port number for the Modbus TCP protocol. An integer tag can also be selected here if changing the Target TCP port is required within the program.
  5. Slave Node: If Ethernet is selected, enter the Target device node. When using Modbus TCP, this value is typically 255 unless interfacing with a protocol converter that forwards Modbus messages. An integer tag can also be selected here if changing the target slave node is required within the program.

  6. Enable TCP Connect:This Boolean must be active to enable a TCP Connection to a Target device.

  7. Serial Port: Select this option if Modbus RTU is to be used for this device.
  8. Slave Node: If Serial is selected, enter the Target device node. An integer tag can also be selected here if changing the target slave node is required within the program.

  9. Use Structure: Select to create a Predefined Structure that contains tags for the instruction elements.

  10. TCP Connected: This Boolean becomes active when an active TCP Connection is present.

  11. TCP/IP Error: This string tag will contain an error created when the TCP connection fails. This tag should be used to help troubleshoot connections to Target devices.


Productivity PLC CPU Configuration



  1. Device Name: Each Productivity PLC CPU added to the Modbus window must contain a unique Device Name that can be selected in the Network Read/Write (NETW) instruction

  2. Ethernet: Select this option if Ethernet is to be used for this device

  3. Target IP Address: If Ethernet is selected, this is where the IP address of the target Productivity CPU is entered. A string tag can also be selected here if changing the target IP address is required within the program

  4. TCP Port Number: If Ethernet is selected, enter the Modbus Server port number of the target Productivity CPU. Typically, this value will need to be 502 as this is the registered TCP port number for the Modbus TCP protocol. An integer tag can also be selected here if changing the target TCP port is required within the program

  5. Enable TCP Connect: This Boolean must be active to enable a TCP Connection to a target device.

  6. Serial Port: Select this option if Modbus RTU is to be used for this device

  7. Slave Node: If Serial is selected, enter the Target device node. An integer tag can also be selected here if changing the target slave node is required within the program.

  8. Remote Project: This is the path and filename of the project to be referenced when reading to or writing from a target Productivity CPU

  9. Read: Select this button to browse to the desired remote project file

  10. Refresh: Select this button to update any tags used in the local project that may have changed in the selected remote project file.

  11. Use Structure: Select to create a Predefined Structure that contains tags for the instruction elements

  12. TCP Connected: This Boolean becomes active when an active TCP Connection is present

  13. TCP/IP Error: This string tag will contain an error created when the TCP Connection fails. This tag should be used to help troubleshoot connections to target devices.

 

Related Topics:

Modbus Device Configuration