Supported modbus/tcp function codes, Unit identifier (port number) – Rockwell Automation 20-COMM-M Modbus/TCP Adapter User Manual

Page 38

Advertising
background image

4-2

Using Modbus/TCP Function Codes

20-COMM-M Modbus/TCP Adapter User Manual
Publication 20COMM-UM014C-EN-P

Supported Modbus/TCP Function Codes

On Modbus/TCP, a register is defined as an addressable container that holds
16-bit data. All parameters (16-bit or 32-bit) for the drive and its connected
peripherals always occupy two consecutive 16-bit registers—one for the Lo
Word and one for the Hi Word—even if the parameter is only a 16-bit word.
In this case, the parameter value is the Lo Word.

The adapter supports the Modbus/TCP function codes listed in

Table 4.A

.

Table 4.A Supported Modbus/TCP Function Codes

Unit Identifier (Port Number)

The Modbus/TCP Application Data Unit includes a Unit Identifier which is
used by a Modbus/TCP gateway to route to remote serial Modbus slave
devices. The 20-COMM-M adapter acts similarly as a gateway to DPI devices
and uses the Unit Identifier as the DPI Port Number (0…6) to access
parameters in those connected peripherals. Since the adapter can be connected
to different ports, a Unit Identifier of “255” can be used to always access
parameters in the adapter. When the specific DPI port to which a device is
connected is known, you can use this port number as the Unit Identifier.

Table 4.B Unit Identifiers

Function
Code

Name

Description

01

Read Coils (also known as
Read Discrete Outputs)

Reads groups of up to 16 output bits simultaneously in the
Logic Command word.

02

Read Discrete Inputs

Reads groups of up to 16 input bits simultaneously in the
Logic Status word.

03

Read Holding Registers
(one or many)

Reads any single or multiple parameters of the drive or its
connected peripherals. It also reads the Logic Command,
Logic Status, Reference, Feedback, or Datalink words.

05

Write Single Coil (also
known as Write Discrete
Output)

Writes to individual output bits or groups of output bits in
the Logic Command word.

06

Write Single Register

Writes to the Logic Command word or Keep-Alive register.

15

Write Multiple Coils (also
known as Write Multiple
Discrete Outputs)

Writes to groups of up to 16 output bits simultaneously in
the Logic Command word.

16

Write Multiple Registers
(one or many)

Writes to any group of parameters of the drive or its
connected peripherals. It also writes to the Logic
Command, Reference, or Datalink (Data In xx) words.

23

Read/Write Multiple
Registers (also known as
Read/Write Parameters)

Reads and/or writes to any group of parameters of the
drive or its connected peripherals. It also reads the Logic
Command, Logic Status, Reference, Feedback, or Datalink
words—and writes to the Logic Command, Reference, and
Datalinks.

43

Read Device Identification

Reads the vendor name, product code, and major/minor
firmware version of the connected drive.

Unit
Identifier

Device Connection (Example)

0

DPI Port 0 (Drive)

1

DPI Port 1 (HIM in drive cradle)

2

DPI Port 2 (remote-mount HIM or adapter in DPI External Comms Kit)

3

DPI Port 3 (peripheral connected to Port 3 of a two-way or four-way splitter cable)

Advertising