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

-

-.

1.
Modbus
-
.
:
--4-8, --5,7-4-8;
--8-8, --5,7-8-8;
--8-16, --5,7-8-16;
--12-8, --5,7-12-8;
--12-16, --5,7-12-16;
--0-16, --5,7-0-16.

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 .

RTU
1 247

1200, 9600, 19200, 38400, 57600, 115200


, ,
1 2
RS-485 (2- ) RS-232

3.
Modbus .
4 ,
/.

Coil

Input Register

16

Holding Register

16


()

()

( )


Discrete Input

-.

bit

float32

/ .
:
0 ;
1 .
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

( )
-8-8; -8-16
-12-8; -12-16
-0-16
1
1
1

float32

-4-8
1

float32

float32

float32

float32

float32

float32

float32

float32

float32

10

10

-.

( )


Modbus
-4-8
-8-8; -8-16
-12-8; -12-16
-0-16
float32
0
3
11
11
20
21
float32
0
4
12
12
22
23
float32
0
0
1
13
24
25
float32
0
0
2
14
26
27
float32
0
0
3
15
28
29
float32
0
0
4
16
30
31
Modbus 16-
Modbus ( ).

3.2. Discrete Input


Discrete Input [02] Read
Discrete Inputs. Discrete Input 3.2.
3.2. Discrete Input

( )

Modbus

-4-8; -8-8; -8-16; -12-8; -12-16


-0-16
bit
0
1
0
bit
1
2
0
bit
2
3
0
bit
3
4
0
Modbus 1-
Modbus ( ).

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


Modbus
0
1
2
3
4
5
6
7
8
9

bit
bit
bit
bit
bit
bit
bit
bit
bit
bit

( )
-4-8; -8-8; -12-8;
-8-16; -12-16; -0-16
1
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
0
9
0
10

-.

( )

Modbus

-4-8; -8-8; -12-8;


-8-16; -12-16; -0-16
bit
10
0
11
bit
11
0
12
bit
12
0
13
bit
13
0
14
bit
14
0
15
bit
15
0
16
Modbus 1-
Modbus ( ).

4. Modbus
:

01
02
03
04
07
15
43



Read Coils
Read Discrete Inputs
Write Single Coil
Read Input Registers
Read Exception status
Write Multiple Coils
Read device Identification

()
()
()
( )

()

Modbus.

4.1. () [01] Read Coils


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

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

1
2
2

0x01
0 15
1 16

(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
0 3
1 4

(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.3. ( ) [04] Read


Input Register
( ).
16-
Modbus. .

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

1
2
2

0x04
0 31

1 31

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

(Function code)
(Exception code)

1
1

Function code + 0x80


01 02 03 04

4.4. [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.5. [43] Read device Identification


Modbus.
(Basic Device Identification):

0x00
0x01
0x02

ASCII
ASCII
ASCII

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

Вам также может понравиться