Professional Documents
Culture Documents
Version 1.20
Page: 1 of 45 NA011 Modbus RTU
NA011
Contents
Contents ........................................................................................................................................................................ 2
1 Introduction ........................................................................................................................................................... 3
2 General ................................................................................................................................................................. 3
2.2 Data type ............................................................................................................................................................. 3
2.1 Data interface in Modbus protocol ............................................................................................................... 4
3 MODBUS .............................................................................................................................................................. 5
3.1 General......................................................................................................................................................... 5
3.2 ModBus communication ............................................................................................................................... 5
3.3 Message format............................................................................................................................................ 6
3.4 CRC: Cyclical Redundancy Check............................................................................................................... 6
3.5 Transmission order of data elements........................................................................................................... 7
3.6 Function 03: Read WREG............................................................................................................................ 7
3.7 Function 04: Read RREG............................................................................................................................. 8
3.8 Function 06: Write single register WREG .................................................................................................... 8
3.9 Function 16: Write single or multiple register WREG................................................................................... 9
3.10 Function 08: loopback diagnostic test .......................................................................................................... 9
3.11 Exception responses .................................................................................................................................. 10
4 DATA STRUCTURE FORMAT ........................................................................................................................... 11
4.1 Format description...................................................................................................................................... 11
4.2 Format description example ....................................................................................................................... 11
5 MODBUS COMMUNICATION EXAMPLE .......................................................................................................... 13
5.1 WREG writing in Modbus communication.................................................................................................. 13
5.2 WREG reading in Modbus communication ................................................................................................ 14
6 RREG STRUCTURES DESCRIPTION .............................................................................................................. 15
7 WREG STRUCTURES DESCRIPTION ............................................................................................................. 23
8 COMMAND MESSAGES INDEX........................................................................................................................ 43
Version 1.20
Page: 2 of 45 NA011 Modbus RTU
NA011
1 Introduction
The protection implements Modbus RTU protocol in remote RS485 half-duplex or local
RS232 connection.
The following operation are supported:
- data reading
- configuration parameters reading and modifying
- command actuation
- communication network test
2 General
Data are structured in 16-bit-wide REGISTERS.
Two class of registers are provided:
- class RREG: read only registers
- class WREG: read/write registers
Version 1.20
Page: 3 of 45 NA011 Modbus RTU
NA011
Section 8 collects WREG structures for command activations.
Commands execution is performed writing the values specified in the command register;
at the end of the execution the register are automatically cleared by the protection.
It is possible to read the command registers as well as any other register.
The diagnostic test of the communication line is performed through the 'loopback
test' ModBus function:
Version 1.20
Page: 4 of 45 NA011 Modbus RTU
NA011
3 MODBUS
3.1 General
The protection implements a functional subset of the RTU ModBus protocol:
FUNC 04: read input register
FUNC 03: read output register
FUNC 06: preset single register
FUNC 16: preset multiple registers
FUNC 08: loopback diagnostic test
The ModBus protocol allows communication within a master unit (personal computer or
supervisor) and different slave devices (multi point system), in our case a
protection system. Every protection is univocally identified by an address (Slave
address) programmable in the field 1...247.
The 'broadcast addressing" (address=0) allows the dispatching of a message to all the
protections of the system: every protection manages the message but it doesn't send
back response to avoid collision on the bus.
The protection allows the remote connection with interface RS485 half-duplex, or
local with interface RS232, through the ModBus RTU protocol.
In remote mode, the protection is shaped as Slave in a multidrop system and it
answers only if addressed by the master (personal computer or supervisor) with own
address (1...247).
In local mode, the protection results to be in point-to-point connection, or
individual with the master (personal computer), it answers any request ignoring the
address.
Version 1.20
Page: 5 of 45 NA011 Modbus RTU
NA011
A B
driver 485 tx on ----------------+
MASTER trasmission ...XXXXXXXX |
driver 485 tx off +----------------------------------
C D
driver 485 tx on +----------------------------
SLAVE trasmission | XXXXXXXXXXXXXXXXX...
driver 485 tx off ----------------------+
where:
B Master 'request' transmission expiring time
B Master transmitter disable
C Slave transmitter enable
D Slave 'answer' start transmission
where:
ADDR protection relay addressing:
- 0 = broadcast
- 1...247 = slave address
FUNC function code:
- 04 read input RREG register
- 03 read output WREG register
- 06 preset single WREG register
- 16 preset multiple WREG registers
- 08 loopback diagnostic test
BODY data body: contents depends from the FUNC code
CRCH MSB CRC byte
CRCL LSB CRC byte
Version 1.20
Page: 6 of 45 NA011 Modbus RTU
NA011
3.5 Transmission order of data elements
Every WORD, UWORD, ENUM or B16 data, expressed by one register (2 bytes), is sent
according to the following order (left to right):
Every LONG, ULONG or B32 data, expressed by two register (4 bytes), is sent according
to the following order (left to right):
Request:
| ADR | DIM |
| H | L | H | L |
|------|------|------|------|
byte 1 byte 2 byte 3 byte 4
Response:
where:
ADR reference to the data structure of WREG class:
ADR =0 if NUM=1, ADR =1 if NUM=2, ... etc.
DIM size of the WREG data structure (number of registers)
NBYTES number of bytes from WREG1 to WREG(DIM): double of DIM
WREG1.. registers that have been read
Version 1.20
Page: 7 of 45 NA011 Modbus RTU
NA011
Request:
| ADR | DIM |
| H | L | H | L |
|------|------|------|------|
byte 1 byte 2 byte 3 byte 4
Response:
where:
ADR reference to the data structure of RREG class:
ADR=0 if NUM=1, ADR=1 if NUM=2, ... etc.
DIM size of the RREG data structure(number of registers)
NBYTES number of bytes from RREG1 to RREG(DIM): double of DIM
RREG1.. registers that have been read
Request:
This service can be used only for data structures WREG composed by one only register.
Message framing:
Request:
| ADR | VALUE |
| H | L | H | L |
|------|------|------|------|
byte 1 byte 2 byte 3 byte 4
where:
ADR reference to the data structure of WREG:
ADR=0 if NUM=1, ADR=1 if NUM=2, ... etc.
VALUE writing value (only one register)
Version 1.20
Page: 8 of 45 NA011 Modbus RTU
NA011
Request:
Response:
| ADR | DIM |
| H | L | H | L |
|------|------|------|------|
byte 1 byte 2 byte 3 byte 4
where:
ADR reference to the data structure of WREG class:
ADR=0 if NUM=1, ADR=1 if NUM=2, ... etc.
DIM size of the WREG data structure(number of registers)
NBYTES number of bytes from WREG1 to WREG(DIM): double of DIM
WREG1.. writing registers
Message framing:
Request:
| CODE | DATA |
| H | L | H | L |
|------|------|------|------|
byte 1 byte 2 byte 3 byte 4
Response:
| CODE | INFO |
| H | L | H | L |
|------|------|------|------|
byte 1 byte 2 byte 3 byte 4
where:
CODE diagnostic test code
DATA accessory data for diagnostic function
INFO data returned from diagnostic test
Version 1.20
Page: 9 of 45 NA011 Modbus RTU
NA011
Here the list of diagnostic codes supported by the serial line devices:
where:
ADDR address
FUNC error code (bit 7 = 1):
To mark error, the most significant bit of the request message is set.
EXCP exception code:
- 01: illegal function -> FUNC non implementata
- 02: illegal data address -> invalid address ADR
- 03: illegal data value -> DIM icorrect value
- 04: slave device failure -> not used
- 05: acknowledge -> not used
- 06: slave device busy -> not used
- 07: negative acknowledge -> generic error:
- framing error in the response
- out of range data
- etc.
- 08: memory parity error -> not used
CRCH MSB byte
CRCL LSB byte
Version 1.20
Page: 10 of 45 NA011 Modbus RTU
NA011
where:
NUM data structure number within proper class:
example: RREG NUM=5 (5th structure of RREG class)
WREG NUM=3 (3th structure of WREG class)
STRU_NAME structure name
NR nr. of register: it points position (nr. of 16 bit registers) within
structure (from 1 to n)
TYPE data type identifier related to NR:
it may be WORD, UWORD, LONG, ULONG, ENUM, B32 o B16.
example: UWORD[ 1] (UWORD data type in first position)
ULONG[ 2] (ULONG data type in second position)
ENUM [ 4] (ENUM data type in 4th position)
B32 [ 5] (B32 data type in 5th position)
B16 [ 7] (B16 data type in 7th position)
DATA_NAME name.
DIM Structure global size (nr. of 16 bit registers)
SYNOPSIS concise collection of message package informations.
It shows the form:
class ... -> ADR=... (NUM=...), DIM=...
Version 1.20
Page: 12 of 45 NA011 Modbus RTU
NA011
|--------------------------------------------------------------------|
|ADDR|FUNC| BODY |CRCH|CRCL|
|----|----|----|----|----|-----|--------|----|--------|----|----|----|
|ADR |DIM |NBYT|UWORD| ULONG |ENUM| B32 |B16 |
|----|----|----|-----|--------|----|--------|----|
21 10 0004 0007 0E 0226 E6081DDA 0001 00120000 0007 2C C5
|-----------------------------|
|ADDR|FUNC| BODY |CRCH|CRCL|
|----|----|----|----|----|----|
|ADR |DIM |
|----|----|
21 10 0004 0007 C7 6A
Version 1.20
Page: 13 of 45 NA011 Modbus RTU
NA011
|-----------------------------|
|ADDR|FUNC| BODY |CRCH|CRCL|
|----|----|----|----|----|----|
|ADR |DIM |
|----|----|
21 03 0004 0007 42 A9
|----------------------------------------------------------|
|ADDR|FUNC| BODY |CRCH|CRCL|
|----|----|----|-----|--------|----|--------|----|----|----|
|NBYT|UWORD| ULONG |ENUM| B32 |B16 |
|----|-----|--------|----|--------|----|
21 03 0E 0226 E6081DDA 0001 00120000 0007 B9 26
Version 1.20
Page: 14 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 15 of 45 NA011 Modbus RTU
NA011
ENUM [ 1] Code (NA011-a ...)
0 NA011-CB0-c
ULONG[ 2] Serial
UWORD[ 4] Firmware release (format: XX.XX hex)
UWORD[ 5] Nominal freq.
Dimension : 5 registers
Synopsis : class RREG -> ADR=1 (NUM=2), DIM=5
Version 1.20
Page: 16 of 45 NA011 Modbus RTU
NA011
Framing :
UWORD[ 1] Records stored
0,2 step 1
UWORD[ 2] Last record
0,2 step 1
Dimension : 2 registers
Synopsis : class RREG -> ADR=6 (NUM=7), DIM=2
Version 1.20
Page: 17 of 45 NA011 Modbus RTU
NA011
UWORD[14] F - Day
1,31 step 1
UWORD[15] F - Hour
0,23 step 1
UWORD[16] F - Minute
0,59 step 1
UWORD[17] F - Second
0,59 step 1
UWORD[18] F - Millisecond
0,999 step 1
Dimension : 18 registers
Synopsis : class RREG -> ADR=9 (NUM=10), DIM=18
Version 1.20
Page: 18 of 45 NA011 Modbus RTU
NA011
33 79 enabled
34 79 manual close
35 79 start
36 79 rapid close
37 79 slow close
38 79 delayed close
39 79 interrupted
40 79 fail phase
41 79 fail earth
42 79 fail external
43 79 rapid ok
44 79 slow ok
45 79 delayed ok
UWORD[ 3] E - Year
2000,2099 step 1
UWORD[ 4] E - Month
1,12 step 1
UWORD[ 5] E - Day
1,31 step 1
UWORD[ 6] E - Hour
0,23 step 1
UWORD[ 7] E - Minute
0,59 step 1
UWORD[ 8] E - Second
0,59 step 1
UWORD[ 9] E - Millisecond
0,999 step 1
Dimension : 9 registers
Synopsis : class RREG -> ADR=11 (NUM=12), DIM=9
Version 1.20
Page: 19 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 20 of 45 NA011 Modbus RTU
NA011
Synopsis : class RREG -> ADR=23 (NUM=24), DIM=1
Version 1.20
Page: 21 of 45 NA011 Modbus RTU
NA011
UWORD[ 1] Counter 79 RR
0,10000 step 1
Dimension : 1 registers
Synopsis : class RREG -> ADR=32 (NUM=33), DIM=1
Version 1.20
Page: 22 of 45 NA011 Modbus RTU
NA011
default: 0
ENUM [ 5] 79 LastEvent
0 None
1 Disable
2 Block
3 Enable
4 Start
5 Manual close
6 Rapid
7 Slow
8 Delayed
9 Rapid OK
10 Slow OK
11 Delayed OK
12 Interrupted
13 Fail phase
14 Fail earth
15 Fail ext
Dimension : 5 registers
Synopsis : class RREG -> ADR=38 (NUM=39), DIM=5
Version 1.20
Page: 23 of 45 NA011 Modbus RTU
NA011
WREG NUM=33 ICLP>>
WREG NUM=34 tCLP>>
WREG NUM=35 t>>RES
WREG NUM=36 I>>def
WREG NUM=37 ICLP>>def
WREG NUM=38 t>>def
WREG NUM=39 ICLP>>>
WREG NUM=40 tCLP>>>
WREG NUM=41 t>>>RES
WREG NUM=42 I>>>def
WREG NUM=43 ICLP>>>def
WREG NUM=44 t>>>def
WREG NUM=45 IE> curve
WREG NUM=46 IECLP>
WREG NUM=47 tECLP>
WREG NUM=48 tE>RES
WREG NUM=49 IE>def
WREG NUM=50 IECLP>def
WREG NUM=51 tE>def
WREG NUM=52 IE>inv
WREG NUM=53 IECLP>inv
WREG NUM=54 tE>inv
WREG NUM=55 IECLP>>
WREG NUM=56 tECLP>>
WREG NUM=57 tE>>RES
WREG NUM=58 IE>>def
WREG NUM=59 IECLP>>def
WREG NUM=60 tE>>def
WREG NUM=61 BF Enable
WREG NUM=62 tBF
WREG NUM=63 IN1 select
WREG NUM=64 IN2 select
WREG NUM=65 IN3 select
WREG NUM=66 AutoReclose set
WREG NUM=67 AutoReclose trigger
Version 1.20
Page: 24 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 25 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 26 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 27 of 45 NA011 Modbus RTU
NA011
ENUM [ 5] Analog channel 1
0 OFF
1 iL1
2 iL2
3 iL3
4 iE
5 measure IL1
6 measure IL2
7 measure IL3
8 measure IE
default: 0
ENUM [ 6] Analog channel 2
0 OFF
1 iL1
2 iL2
3 iL3
4 iE
5 measure IL1
6 measure IL2
7 measure IL3
8 measure IE
default: 0
ENUM [ 7] Analog channel 3
0 OFF
1 iL1
2 iL2
3 iL3
4 iE
5 measure IL1
6 measure IL2
7 measure IL3
8 measure IE
default: 0
ENUM [ 8] Analog channel 4
0 OFF
1 iL1
2 iL2
3 iL3
4 iE
5 measure IL1
6 measure IL2
7 measure IL3
8 measure IE
default: 0
Dimension : 8 registers
Synopsis : class WREG -> ADR=12 (NUM=13), DIM=8
Version 1.20
Page: 28 of 45 NA011 Modbus RTU
NA011
WREG NUM=15 Description : Event read
Framing :
UWORD[ 1] Event read
1,50 step 1
default: 1
Dimension : 1 registers
Synopsis : class WREG -> ADR=14 (NUM=15), DIM=1
Version 1.20
Page: 29 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 30 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 31 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 32 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 33 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 34 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 35 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 36 of 45 NA011 Modbus RTU
NA011
WREG NUM=42 Description : I>>>def
Framing :
UWORD[ 1] I>>>def (1000=1 In)
100,999 step 1
1000,9990 step 10
10000,20000 step 100
default: 1000
Dimension : 1 registers
Synopsis : class WREG -> ADR=41 (NUM=42), DIM=1
Version 1.20
Page: 37 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 38 of 45 NA011 Modbus RTU
NA011
WREG NUM=53 Description : IECLP>inv
Framing :
UWORD[ 1] IECLP>inv (1000=1 In)
5,999 step 1
1000,2000 step 10
default: 2000
Dimension : 1 registers
Synopsis : class WREG -> ADR=52 (NUM=53), DIM=1
Version 1.20
Page: 39 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 40 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 41 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 42 of 45 NA011 Modbus RTU
NA011
Version 1.20
Page: 43 of 45 NA011 Modbus RTU
NA011
WREG NUM=19 K1 0
K1 logic De-energized (0)
K1 mode No-latched (0)
K1 tTR 200 ms (20)
WREG NUM=20 K2 0
K2 logic De-energized (0)
K2 mode No-latched (0)
K2 tTR 200 ms (20)
WREG NUM=21 K3 0
K3 logic De-energized (0)
K3 mode No-latched (0)
K3 tTR 200 ms (20)
WREG NUM=22 K4 0
K4 logic De-energized (0)
K4 mode No-latched (0)
K4 tTR 200 ms (20)
Version 1.20
Page: 44 of 45 NA011 Modbus RTU
NA011
WREG NUM=34 tCLP>> 0.10 s (10)
Version 1.20
Page: 45 of 45 NA011 Modbus RTU