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 Supported Modbus/TCP Function Codes
Function
Name
Code
01
Read Coils (also known as
Read Discrete Outputs)
02
Read Discrete Inputs
03
Read Holding Registers
(one or many)
05
Write Single Coil (also
known as Write Discrete
Output)
06
Write Single Register
15
Write Multiple Coils (also
known as Write Multiple
Discrete Outputs)
16
Write Multiple Registers
(one or many)
23
Read/Write Multiple
Registers (also known as
Read/Write Parameters)
43
Read Device Identification
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
Unit
Device Connection (Example)
Identifier
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)
Description
Reads groups of up to 16 output bits simultaneously in the
Logic Command word.
Reads groups of up to 16 input bits simultaneously in the
Logic Status word.
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.
Writes to individual output bits or groups of output bits in
the Logic Command word.
Writes to the Logic Command word or Keep-Alive register.
Writes to groups of up to 16 output bits simultaneously in
the Logic Command word.
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.
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.
Reads the vendor name, product code, and major/minor
firmware version of the connected drive.
Table
4.A.
Need help?
Do you have a question about the 20-COMM-M Modbus/TCP Adapter and is the answer not in the manual?
Questions and answers