Accessing device parameters, Direct access method, Accessing device parameters -9 – Rockwell Automation 20-COMM-M Modbus/TCP Adapter User Manual

Page 45

Advertising
background image

Using Modbus/TCP Function Codes

4-9

20-COMM-M Modbus/TCP Adapter User Manual

Publication 20COMM-UM014C-EN-P

Accessing Device Parameters

There are two methods for accessing parameters in the drive or its
connected peripherals: the direct access method (for individual or
contiguous parameters) and the indirect access method (for contiguous or
non-contiguous parameters).

Direct Access Method

You can use Function Code 03 or 23 to read single or multiple device (drive
or its connected peripheral) parameters, and Function Code 16 or 23 to
write single or multiple device parameters (see

Table 4.A

). However,

Function Code 06 (Write Single Register) cannot be used because all device
parameters being written to require two contiguous register addresses.

By using the appropriate Unit Identifier for a device (

Table 4.B

), you can

directly access its parameters. Device parameter data is always contained in
a Lo Word and a Hi Word which reside in contiguous Modbus/TCP register
addresses. Therefore, the data in the starting register address and the next
contiguous register address must be read together as a pair. The starting
register address is determined by:

Starting Register Address = (Device Parameter No. x 2) - 1

For example, to access drive Parameter 003 - [Output Current] first set the
Unit Identifier to 0 (zero) to access drive parameters. Then use the formaula
above to determine the starting register address for drive Parameter 003 -
[Output Current] data:

Starting Register Address = (3 x 2) - 1 = 5

In this example, read both the starting register address 5 (Lo Word) and
register address 6 (Hi Word) to receive drive Parameter 003 - [Output
Current] data.

!

ATTENTION: Risk of equipment damage exists. When data
registers are used to write parameter data to Non-Volatile Storage
(NVS) frequently, the NVS will quickly exceed its life cycle and
cause the drive to malfunction. Do not create a program that
frequently writes parameter data to NVS. Datalinks do not write
to NVS and should be used for frequently changed parameters.
See

Using Datalinks on page 4-12

for more information.

TIP: For a 0-based Modbus/TCP master device, subtract 1 for the starting
register address. Therefore, in the example above, read both the starting
register address 4 (Lo Word) and register address 6 (Hi Word) to receive
drive Parameter 003 - [Output Current] data.

Advertising