B–10

Network Protocol Reference

Explanation of function codesRead Coil Status [01h]:

This function reads the status (ON/OFF) of selected coils. An example follows below.

Read intelligent input terminals [1] to [5] of an inverter having a slave address “8.”

This example assumes the intelligent input terminals have terminal states listed below.

Item

 

 

Data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Intelligent input

[1]

[2]

[3]

[4]

[5]

terminal

 

 

 

 

 

 

 

 

 

 

 

Coil Status

ON

ON

ON

OFF

ON

 

 

 

 

 

 

Appendix B

Query:

No.

Field Name

Example

(Hex)

 

 

 

 

 

 

 

 

1

Slave address *1

08

 

 

 

2

Function code

01

 

 

 

3

Coil start number

00

 

(high order)

 

 

 

 

4

Coil start number

07

 

(low order)

 

 

 

 

5

Number of coils

00

 

(high order) *2

 

 

 

 

6

Number of coils (low

06

 

order) *2

 

 

 

 

7

CRC-16 (high order)

0D

 

 

 

8

CRC-16 (low order)

50

 

 

 

Response:

No.

Field Name

Example

(Hex)

 

 

 

 

 

 

 

 

 

1

Slave address

08

 

 

 

2

Function code

01

 

 

 

3

Data size (in bytes)

01

 

 

 

4

Coil data *3

17

 

 

 

 

5

CRC-16

(high order)

12

 

 

 

 

6

CRC-16

(low order)

1A

 

 

 

 

Note 3: Data is transferred by the specified number of data bytes (data size).

Note 1: Broadcasting is disabled.

Note 2: When 0 or more than 32 is specified as a number of coils, error code “03h” is returned.

The data set in the response shows terminal states of coils 7 to 14.

Data “17h = 00010111b” indicates the following assuming coil 7 is the LSB.

 

Item

 

 

 

 

Data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Coil Number

14

13

12

11

 

10

9

8

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Coil Status

OFF

OFF

OFF

ON

 

OFF

ON

ON

ON