Вы находитесь на странице: 1из 8

--104

--104.

1.
Modbus
--104
.

2. Modbus
Modbus:
MODBUS Application Protocol Specification V1.1 04.06.2004 .
MODBUS Over serial line. Specification and implementation guide V1.0 12.02.2002 .
MODBUS Messaging on TCP/IP Implementation Guide V1.0b

: RS-485





: Ethernet

Modbus RTU
1 247

1200, 9600, 19200, 38400, 57600, 115200, 234000


, ,
1, 2
RS-485 (2- )
Modbus/TCP
502 (TCP)

3.
Modbus .
4 ,
/.

Coil

Input Register

16

Holding Register

16


Discrete Input

bit

/ .
:
0 ;
1 .

--104.

float32 32

/
. IEEE-754
( 32 ).
16- Modbus.
:

Modbus
1

1
( 8-15)
2
( 0-7)
2
1
( 24-31)
2
( 16-22)
,
2- 16-
Modbus, 32-
IEEE-754.

3.1. Input Register


Input Register [04] Read
Input Register. Input Register 3.1.
3.1. Input Register
Modbus

0
float32
1
2
float32
3
4
float32
5
6
float32
7
8
float32
9
10
float32
11
12
float32
13
14
float32
15
16
float32
17
18
float32
19
20
float32
21
22
float32
23
24
float32
25
26
float32
27
28
float32
29
30
float32
31

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

--104.
Modbus
32
33
34
35
36
37
38
39
40
41
42
43


float32

17

float32

18

float32

19

float32

20

float32

21

float32

22

44-119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

float32

23

float32

24

float32

25

float32

26

float32

27

float32

28

float32

29

float32

30

float32

31

float32

32

Modbus 16-
Modbus ( ).


. ,
, 3.1

.

--104.

--104-4-4-8:

1
2
3
4
1
2
3
4
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7

()
()
()
()
20
20
20
20

.
.
.
.
.
.
.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Modbus

0
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
120

,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
40
41
121

2.1.25.0 (.
3.2).
3.2. Input Register ( v2.1.25+)
Modbus

318
float32
1
319
320
float32
2
321

444
float32
64
445

3.1. Holding Register


Holding Register [03] Read
Holding Register. 16 (0x10) Write
Multiple registers Holding Register 3.3.
3.3. Holding Register
Modbus

0
float32
1
1
2
float32
2
3

62
float32
32
63

Modbus 16-
Modbus ( ).

--104.

3.2. Discrete Input


Discrete Input [02] Read
Discrete Inputs. Discrete Input 3.4.
3.4. Discrete Input
Modbus

0
bit
1
bit

31
bit

1
2

32

Modbus 1-
Modbus ( ).

3.3. Coil
Coil [01] Read Coils.
05 (0x05) Write Single Coil 15 (0x0F)
Write Multiple Coils. Coil 3.5.
3.5. Coil
Modbus

0
bit
1
bit

31
bit

1
2

32

Modbus 1-
Modbus ( ).

4. Modbus
:


01
Read Coils
()
02
Read Discrete Inputs
()
03
Read Holding Registers
()
04
Read Input Registers
( )
15
Write Multiple Coils
()
16
Write Multiple Registers
()
07
Read Exception status

43
Read device Identification

Modbus.

4.1. () [01] Read Coils


().
.
. .
0 , 1
. 8,
0.

(Function code)
(Starting Address)
(Quantity of coils)

1
2
2

0x01

--104.

(Function code)
1
0x01
(Byte count)
1
N*
(Coil Status)
n
n = N N+1
*N = / 8, 0, N = N+1

(Function code)
(Exception code)

1
1

Function code + 0x80


01 02 03 04

4.2. () [02] Read


Discrete Inputs
().
.
. .
0 , 1
. 8,
0.

(Function code)
(Starting Address)
(Quantity of Inputs)

1
2
2

0x02

(Function code)
1
0x02
(Byte count)
1
N*
(Input Status)
N* x 1 n = N N+1
*N = / 8, 0, N = N+1

(Function code)
(Exception code)

1
1

Function code + 0x80


01 02 03 04

4.1. (E) [03] Read


Holding Registers
().
16- Modbus.
.

(Function code)
(Starting Address)
(Quantity of Input Registers)

1
2
2

(Function code)
1
(Byte count)
1
Input Registers
N* x 2 Byte
*N = (Quantity of Input Registers)

0x03

0x03
2 x N*

--104.


(Function code)
(Exception code)

1
1

Function code + 0x80


01 02 03 04

4.2. [04] Read Input


Registers
.
16- Modbus.
.

(Function code)
(Starting Address)
(Quantity of Input Registers)

1
2
2

(Function code)
1
(Byte count)
1
Input Registers
N* x 2 Byte
*N = (Quantity of Input Registers)

(Function code)
(Exception code)

1
1

0x04

0x04
2 x N*

Function code + 0x80


01 02 03 04

4.3. [07] Read Exception status


.

(Function code)

0x07

(Function code)
(Exception code)

1
1

0x07
0x00 , ,


(Function code)
(Exception code)

1
1

Function code + 0x80


01 04

4.4. [43] Read device Identification


Modbus.
(Basic Device Identification):

0x00
0x01
0x02

ASCII
ASCII
ASCII

"SpecAuto"
"Elmetro-VR"
"v1.3.1"