P3 Modbus-Configuration
P3 Modbus-Configuration
www.schneider-electric.com
Table of Contents Modbus configuration instructions
Table of Contents
1. About this document..................................................................... 4
1.1. Purpose............................................................................................................4
1.2. Abbreviations and terms.................................................................................. 4
2. Modbus overview.......................................................................... 5
3. Modbus configuration....................................................................8
3.1. Activating Modbus RTU................................................................................... 8
3.2. Configuring Modbus RTU.................................................................................8
3.3. Configuring and activating Modbus TCP ........................................................ 9
3.4. Clock synchronization.................................................................................... 10
3.5. Events............................................................................................................ 11
3.6. Scaling........................................................................................................... 12
P3APS18025EN 3
Modbus configuration instructions 1. About this document
1.1. Purpose
The purpose of this document is to describe the configuration and use of the
Modbus RTU and Modbus TCP in Easergy P3 protection devices.
Term Description
COMTRADE Common format for transient data exchange. File format for storing
oscillography and status data related to transient power system
disturbances.
EF Earth fault
HR Holding register
OC Overcurrent
4 P3APS18025EN
2. Modbus overview Modbus configuration instructions
2. Modbus overview
The Modbus protocol is a master-slave protocol typically implemented on an
RS-232 or RS-485 physical interface. There are two versions of the serial Modbus
protocol: Modbus RTU and Modbus ASCII, of which Modbus RTU is available in
Easergy P3 devices. There is also a TCP/IP implementation of the protocol,
Modbus TCP.
Modbus TCP is simply the Modbus RTU protocol with a TCP interface that runs
on Ethernet. TCP/IP refers to the transmission control protocol and Internet
Protocol which provide the transmission medium for Modbus TCP messaging. In
practice, Modbus TCP embeds a standard Modbus data frame into a TCP frame.
Modbus RTU and Modbus TCP can be used to transfer the following types of
data:
• events
• status information
• measurements
• control commands
• clock synchronization
• protection settings
• disturbance recordings
In the master-slave setup of Modbus, only the master can initiate transactions
(queries). The slaves respond by supplying the requested data to the master or
by taking the action requested in the query. The master can address individual
slaves or initiate a broadcast message to all slaves. The address space for slaves
in Modbus RTU ranges from 1-247 on one data link. Address 0 is reserved for
broadcast.
The Modbus protocol defines four different categories of data. The mapping of
data to these categories is implementation dependent. In Easergy P3 devices, all
data is mapped to the holding registers.
Discrete input Single bit Read-only This type data can be provided by an I/O
system.
Input registers 16-bit word Read-only This type of data can be provided by an I/O
system.
P3APS18025EN 5
Modbus configuration instructions 2. Modbus overview
NOTE:
• The data mappings are visible only when the Modbus protocol is
activated. For instructions on how to activate the protocol, see Chapter 3.
Modbus configuration.
• The values in the Address column (for example 40xxxx) consist of two
parts: “40” and “xxxx”, where the prefix “40” denotes a reference to Read/
Write Output or Holding Registers and “xxxx” denotes the address of a
particular register.
• The holding register address sent via Modbus is one less than that
indicated by a device. For example, if the Alive Indicator, holding register
address 2001, is sent over a Modbus data link, the frame indicates that
the address of the holding register is 2000.
The bit rate of Modbus RTU is typically 9600 bps and for the transmission of
frames, a parity check mode must be selected (even, odd or none parity
checking).
6 P3APS18025EN
2. Modbus overview Modbus configuration instructions
Related tasks
Activating Modbus RTU on page 8
Configuring and activating Modbus TCP on page 9
P3APS18025EN 7
Modbus configuration instructions 3. Modbus configuration
3. Modbus configuration
2. Under Remote port, select “ModBusSlv” from the Remote port protocol
drop-down menu.
• After changing the communication protocol, for the changes to take effect,
reboot the device.
• The protocol can also be enabled via the local panel of the device. You must
enter the password for the configurator access level via the local panel before
this is possible. See the manual for the device at hand for more instructions.
8 P3APS18025EN
3. Modbus configuration Modbus configuration instructions
NOTE: The parity and bit rate must be set to the same value on all
devices connected to the same data link.
Related tasks
Activating Modbus RTU on page 8
P3APS18025EN 9
Modbus configuration instructions 3. Modbus configuration
NOTE:
◦ There are two different Ethernet protocols, Ethernet protocol 1 and 2.
Modbus TCP can be selected to only one of them. The other protocol
can be for example IEC 61850.
◦ Two Modbus TCP masters can communicate with the device
simultaneously.
◦ Serial Modbus RTU can be used at the same time with Modbus TCP
masters.
The clock can be synchronized either completely (all fields: seconds, minutes,
hours, days, month and year) or by synchronizing only the minutes, which in turn
sets the seconds and milliseconds to zero.
10 P3APS18025EN
3. Modbus configuration Modbus configuration instructions
These two ways of synchronizing the clock are denoted “Set RTC”, where “RTC”
stands for real-time clock and “Synchronise Minutes” in the data map. The holding
register address of the minute synchronisation is 2502.
2507 Year
For Modbus TCP, clock synchronisation can also be done by using simple
network time protocol (SNTP). This requires a NTP server, the address of which
is set in the Protocol configuration > Ethernet port setting view in Easergy Pro.
3.5. Events
The device’s event buffer can be read via the Modbus RTU protocol by reading
one event at a time, from holding registers 2101…2105. The event registers
contain the latest event, and are cleared when they are read. The registers are
then updated to contain the following event from the event buffer.
P3APS18025EN 11
Modbus configuration instructions 3. Modbus configuration
Events are coded with a numbering starting from 0. To obtain the meaning of
these event codes, run the GETSET-command “get eventcodes” in the terminal
software (for example PuTTY).
3.6. Scaling
Holding registers are 16 bits in size, so they can directly represent 216 = 65535
different values, which might not be enough to describe the values of some
physical quantity such as voltage or power. Thus, values transmitted over a
Modbus data link must be scaled to account for this.
The scaling is determined by the equation of the line connecting two points in a
two-dimensional space, (x1, y1) and (x2, y2). That is, the trajectory of the line and
the offset from origin. Note that there is no offset in the example if the point (x1,
y1) is assumed to lie at the origin.
It is common to use scaling factors with base ten (10, 100, 1000…) since, in such
cases, the original measurements only lose decimals and such values are easy to
read and re-scale to actual values on the client side after transmission. Note that
the scaled measurements get rounded.
Different settings for scaling can be used for the power, power factor, tan phi,
voltage and frequency scaling. These can be set in the Communication >
Modbus & Profibus scalings setting view item in Easergy Pro.
A short example: The frequency is internally (in the device) stored as a integer
value which also holds three decimal places, that is, 50.000 Hz is represented as
12 P3APS18025EN
3. Modbus configuration Modbus configuration instructions
50000. This is a value too large to be represented with 16 bits (signed integer),
however, frequency is by default scaled with the points: (x1, y1) = (0, 0) and (x2,
y2) = (10, 1), enabling it to be sent over Modbus.
𝑦 2 − 𝑦1 1−0
𝑘= = = 0.1
𝑥2 −𝑥 1 10 − 0
Thus, the value on the receiving side (the Modbus value) is:
To make sure that a scaling has been set as intended, you can check it in
Easergy Pro by viewing the Scaling column for each holding register in the
Modbus data mapping lists, for example in Communication > Modbus slave
401491.
For an example of scaling change, see Figure 9 - Voltage scaling changed from
default (x2 changed to 10 from 1) on page 14, Figure 10 - Result of the change
in voltage scaling on page 14 and Figure 11 - Default scaling for some holding
registers on page 14.
P3APS18025EN 13
Modbus configuration instructions 3. Modbus configuration
NOTE: To avoid overflow, scale values so that they are kept in the interval 0–
32768 .
14 P3APS18025EN
4. Additional information about some Modbus registers Modbus configuration instructions
The most important protection settings can be read and written using Modbus
registers starting from address 5001.
Modbus holding registers are 16 bits wide. However, some of the parameters
which have been mapped to these registers in the device have 32-bit values.
These parameters are mapped to two consecutive 16-bit holding registers, so that
the register with the smaller address represents the LSB 16-bit word for the
parameter and the second register represents the MSB 16-bit word for the
parameter.
In the current firmware version, all parameters (and only the parameters) which
occupy two consecutive holding registers have 32-bit values.
When the value of such parameter is updated through Modbus, the client must
perform two write operations: one for the LSB word and another for the MSB
word. Each write operation updates the value of the parameter, so that only the
word being written to is modified. The intermediate state for the parameter—
where only one word has been updated—may represent an invalid value for the
parameter. For example, the value may be out of allowed range. In such case the
first write operation gives an error message, indicating that the value of the
parameter was not updated. The client can nevertheless continue with the second
write operation. This second write operation modifies the incomplete intermediate
state of the parameter. If the intermediate state then reaches a valid 32-bit value
for the parameter, the second write operation should indicate a success.
P3APS18025EN 15
Modbus configuration instructions 4. Additional information about some Modbus registers
The client can, for example, first write the LSB 16-bit word for the parameter and
then write the MSB 16-bit word for the parameter, and the parameter should have
the new 32-bit value after the second write operation. The two 16-bit words can
be written in any order. These two write operations should occur within two
seconds of each other.
One recording consists of two files: a CFG file describes what was recorded in the
recording, and a DAT file contains the recorded values.
Register Content
16 P3APS18025EN
4. Additional information about some Modbus registers Modbus configuration instructions
Register Content
Disturbance recordings (COMTRADE files) can be read via registers starting from
5400.
1. Open Modbus connection to the device.
2. Read status register 1 (5401), and check that there is at least one recording
available.
3. Construct a value for the command which starts the download process.
For example, value 271 (0x0x10F) starts download of the second oldest
record.
Write this value to the command register (5400). This command indicates
which recording you want to read and whether you want to download both
CFG file and DAT file, or only either one at a time. This enables “chunk auto-
incrementing”, which means that whenever we read the value of status
register 1, the contents of the data registers are updated to contain the next
fragments of data for the file which is currently downloading.
4. Make a read request that starts from status register 1 (5401) and continues
until the end of the data registers (registers 5403...5498).
This is a total of 96 + 2 = 98 registers.
P3APS18025EN 17
Modbus configuration instructions 4. Additional information about some Modbus registers
b4 Flag for last chunk of data If this flag is set, the data
for this file registers contain the last
pieces of data for the file
which we are currently
downloading. When next
chunk is triggered, we get
the first pieces of data for
another file. (With auto-
increment, this triggering
happens when the status
register 1 is read.)
b2 Flag for DAT file now being If set, indicates that we are
loaded now downloading the DAT
file.
(LSB) b0 Flag for valid data in data If this flag is set, the data
registers registers DO contain valid
data for the files being
downloaded. Absence of
this flag indicates either an
error or that the download
is complete.
18 P3APS18025EN
4. Additional information about some Modbus registers Modbus configuration instructions
6. Assuming that you now have valid data for the download, inspect the value of
status register 2 (4602).
NOTE: The data registers hold 16-bit values (two bytes), while the amount
of data is reported in bytes. The data registers should be filled with data
(giving value 192 here), unless the last pieces of content for the file are
now in the data registers.
You can always read all data registers, and then ignore those which do not
contain valid data, or first read the two status registers, and then, with a
separate read command, read only those data registers which actually contain
data. Also, you may choose to read only at most M registers at a time, so that
M is smaller than the total number of data registers (96). These options may
be useful if the used communication link is slow or expensive.
If the link is prone to transfer errors, you can choose to read a given data
register several times, and use the value which occurs most commonly. In this
use case, it is recommended not to use the auto-increment feature.
7. Copy data from the data registers to the file which is currently being
downloaded.
Note the actual amount of (valid) data in the registers that was discovered in
step 5. If this is the last chunk of data for this file, then after the data has been
written to the file, close the file. When the next pieces of data are received,
you can open a new file. Flags on status register 1 indicate which file is then
being downloaded.
Register Explanation
2110 Last fault current from any dir/undir OC stage (can be cleared)
P3APS18025EN 19
Modbus configuration instructions 5. Testing Modbus with Simple Tester
C
D
E
20 P3APS18025EN
5. Testing Modbus with Simple Tester Modbus configuration instructions
d. The cable adapter connects the pins 2,3, and 7 of the device’s RS-232
cable’s D-connector to pins 2,3, and 5 of the D-connector of the PC’s
cable.
• To connect the device to the PC via Ethernet interface:
Parameter Value
Protocol Modbus
P3APS18025EN 21
Modbus configuration instructions 5. Testing Modbus with Simple Tester
Related tasks
Configuring Modbus RTU on page 8
Connecting the device to the PC running Simple Tester on page 20
Parameter Value
Protocol Modbus
Port 502
22 P3APS18025EN
5. Testing Modbus with Simple Tester Modbus configuration instructions
Related tasks
Configuring and activating Modbus TCP on page 9
Connecting the device to the PC running Simple Tester on page 20
P3APS18025EN 23
Modbus configuration instructions 5. Testing Modbus with Simple Tester
Figure 16 - Performing a cyclic read on the Alive Counter with Simple Tester
Parameter Description
Index Select which data item to read from the device. See the data mapping
provided by Easergy Pro.
Count Indicates how many consecutive indices are to be read. For example,
setting Index to 2001 and Count to 2 displays the values of Index 2001
and Index 2002 in the Values box.
Related tasks
Connecting the device to the PC running Simple Tester on page 20
24 P3APS18025EN
5. Testing Modbus with Simple Tester Modbus configuration instructions
Clock synchronisation can also be performed with Simple Tester by setting the
desired behavior in the time controls settings. The two leftmost fields are used for
setting the time manually, but the time can also be taken from the PC, by
selecting the PC Time checkbox.
Related concepts
Simple Tester on page 20
P3APS18025EN 25
Schneider Electric
35 rue Joseph Monier
92500 Rueil Malmaison - France
Phone: +33 (0) 1 41 29 70 00
www.schneider-electric.com
P3APS18025EN — 04/2019