Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Interface for Modbus Ethernet PLC

Tag groups

  • Last UpdatedNov 17, 2022
  • 2 minute read

Due to the functionality of the Modbus application protocol, a single read request may result in a response with data for up to 2,000 tags. The table below lists the maximum number of coils, inputs or registers that may be read with a single request:

Function Code

Description

Maximum Quantity

1

Read Coils

2000 coils

2

Read Discrete Inputs

2000 inputs

3

Read Holding Registers

125 registers

4

Read Input Registers

125 registers

To enhance performance by maximizing the use of a single read request, the interface will place tags in groups based on the Ethernet node, PLC node (location2), function code (location3), data type (location3) and scan class (location4) being equal and the data offset (location5) being within a range of offsets based on the maximum quantity of values that can be requested. Given that the Modbus application protocol allows for a maximum of 250 bytes of data in a response, the following formula is used to compute the maximum number of register values that may be read in a single request (since coils and discrete inputs are bits, the maximum number is fixed):

Maximum Quantity = 250 / (Registers per data type * 2 bytes per register)

For example, since data type 1 (16-bit integer) is represented in a single register, the maximum quantity of values in input or holding registers that can be read by a single request is 125. On the other hand, since data type 7 (4-byte integer) is represented in two registers, the maximum quantity of values in input or holding registers that can be read by a single request is 62 (in this case the maximum quantity is rounded down so that the total number of bytes does not exceed 250).

The data offset range for a tag group is predetermined by the interface and is computed based on the maximum quantity of values allowed in a single read request and the first valid data offset. For example, given a data type with a value represented by single 2-byte register, a maximum quantity allowed of 125 values and 2,000 available registers, the first tag group would contain offsets 1 to 125, the second tag group offsets would be 126 to 250, and so on. The following table demonstrates the ranges of offsets for tags with function code 3 (read holding registers) and data type 1 (signed 16-bit integer):

Tag Group

First Offset

Last Offset

1

1

125

2

126

250

3

251

375

4

376

500

-

-

16

1876

2000

Related Links
TitleResults for “How to create a CRG?”Also Available in