Addressing Tips (Modbus Convention)

<< Click to Display Table of Contents >>

 

Addressing Tips (Modbus Convention)

On topic Configuring an I/O Tag, Tag addressing, that is, N4/B4 parameters on numerical configuration, is described based on the most recent Modbus protocol specification, version 1.1b. However, there are devices that still use the old offset addressing convention known as Modbus Convention, which adds offsets to an address. This topic explains how to address Tags if a device's register mapping still follows that old convention, originated from initial Modicon specification, not included on the current specification.

The address provided in the Tag is sent together with protocol's request frame, with or without the default offset of 1 (one), required by the Modbus Data Model specified by the protocol, according to the configuration in the Data Model Offset option, on the Modbus tab of this Driver's configuration window.

In addition to this default offset of 1 (one), defined on the current Modbus standard, version 1.1b, some manufacturers still use the old Modicon standard, known as Modbus Convention, with an offset that can be added to the address, and whose value depends on the Modbus function used, or more specifically, depends on which addressing space this function accessed originally. Such additional offset must be ignored when defining Tag addresses on this Driver. Later on this Manual there are more examples. The next table lists all offsets used by the Modbus Convention standard.

Modbus Convention standard offsets

Data Type (Standard Data Model)

Modbus Function

Offset

Coils

01: Read Coils (0x), 05: Write Single Coil (0x), and 15: Write Multiple Coils (0x)

000000

Discrete Inputs

02: Read Discrete Inputs (1x)

10000

Input Registers

04: Read Input Registers (3x)

30000

Holding Registers

03: Read Holding Registers (4x), 06: Write Single Register (4x), and 16: Write Multiple Registers (4x)

40000

File Register (old Extended Memory file)

20: Read General Reference (6x) and 21: Write General Reference (6x)

60000

 

If a device's register map uses this convention, users must follow this procedure to determine the addresses to attribute to Tags, in the Item field when configuring by Strings or in N4 or B4 parameters for numerical configuration:

1.On the Modbus tab, select the Data is addressed from 1 option.

2.Subtract from the address displayed on device's manual the offset shown on the previous table for the Modbus function used. TIP: Remove the fifth digit from right to the left.

 

Notice that, in devices that use this old convention, users can determine which Modbus functions can be used to access each register or bit using the offset used in its address.

Examples

Address with Offset (Device)

Address on I/O Tag (Item or N4/B4)

Modbus Function

01234

1234

01: Read Coils, 05: Write Single Coil, and 15: Write Multiple Coils

11234

1234

02: Read Discrete Inputs

31234

1234

04: Read Input Registers

41234

1234

03: Read Holding Registers, 06: Write Single Register, and 16: Write Multiple Registers

45789

5789

03: Read Holding Registers, 06: Write Single Register, and 16: Write Multiple Registers

65789

5789

20: Read General Reference and 21: Write General Reference

 

Modbus functions 20 and 21 are intended to manipulate reading or writing of multiple subgroups of data, allocated in the equipment's extended memory, or 6XXXXX references, according to the next table.

Extended memory or 6XXXXX references

Memory File Number 1

Memory File Number 2

Memory File Number 3

Register 600100

Data 1

Register 600200

Data 1

Register 600300

Data 1

Register 600101

Data 2

Register 600201

Data 2

Register 600301

Data 2

Register 600102

Data 3

Register 600202

Data 3

Register 600302

Data 3

Register 600103

Data 4

Register 600203

Data 4

Register 600303

Data 4

Register 600104

Data 5

Register 600204

Data 5

Register 600304

Data 5

 

To use a PLC Tag to read the second register of Memory File Number 2 of Slave ID 1 (one), use the following parameters:

Numerical Configuration: N1 = 1, N2 = Oper, N3 = 2, N4 = 201

String Configuration: Item = 1:fr2.201

 

To use a Block Tag with 3 (three) Elements to read the last three registers of Memory File Number 3 of Slave ID 2 (two), use the following parameters:

Numerical Configuration: N1 = 2, N2 = Oper, N3 = 3, N4 = 302

String Configuration: Item = 2:fr3.302

 

To use a PLC Tag for writing in the fourth register of Memory File Number 1 of Slave ID 3 (three), use the following parameters:

Numerical Configuration: N1 = 3, N2 = Oper, N3 = 1, N4 = 103

String Configuration: Item = 3:fr1.103

 

NOTE

The Modbus protocol allows users to read or write multiple subgroups (file number) of data through a single request via functions 20 or 21 respectively. However, this Driver only allows users to manipulate one subgroup of data at a time in each PLC or Block Tag.

Was this page useful?