beautypg.com

2 02 (0x02) read discrete inputs, 3 03 (0x03) read holding registers, 4 04 (0x04) read input registers – Yokogawa EJX930A User Manual

Page 33: 5 05 (0x05) write single coil, 02 (0x02) read discrete inputs -2, 03 (0x03) read holding registers -2, 04 (0x04) read input registers -2, 05 (0x05) write single coil -2

background image

<5. Modbus Communication>

5-2

IM 01C25R05-01EN

5.4.2 02 (0x02) Read Discrete Inputs

Specified quantity of Discrete Inputs contents is

read from Specified Starting Address.

Not corresponding to Broadcast.

Request

Items

Size [byte]

Data

Address

1

1 to 247

Function code

1

0x02

Starting Address

2

0x0000 to 0xFFFF

Quantity of Inputs 2

-

CRC

2

-

Response

Items

Size [byte]

Data

Address

1

1 to 247

Function code

1

0x02

Byte count

1

N

*1

Input Status

*2

N

*1

CRC

2

-

*1:

N is 1 when quantity of Discrete Inputs is less than or

equal to 8.

*2:

e.g. When reading address is 1000 – 1007, MSB is 1007

and LSB is1000.

5.4.3 03 (0x03) Read Holding Registers

Specified quantity of Holding Registers contents is

read from Specified Starting Address.

Not corresponding to Broadcast.

Request

Items

Size [byte]

Data

Address

1

1 to 247

Function code

1

0x03

Starting Address

2

0x0000 to 0xFFFF

Quantity of

Registers

2

-

CRC

2

-

Response

Items

Size [byte]

Data

Address

1

1 to 247

Function code

1

0x03

Byte count

1

N

*1

×2

Register value

*2

N

*1

×2

CRC

2

-

*1:

N: The quantity specified by the Quantity of Registers.

*2:

Transmitted by the order: Upper- Lower from the specified

Starting Address.

E.g. 10 in FLOAT format, Transmit order is as

0x41200000.

5.4.4 04 (0x04) Read Input Registers

Specified quantity of Input Registers contents is

read from Specified Starting Address.

Not corresponding to Broadcast.

Request

Items

Size [byte]

Data

Address

1

1 to 247

Function code

1

0x04

Starting Address

2

0x0000 to 0xFFFF

Quantity of

Registers

2

-

CRC

2

-

Response

Items

Size [byte]

Data

Address

1

1 to 247

Function code

1

0x04

Byte count

1

N

*1

×2

Register value

*2

N

*1

×2

CRC

2

-

*1:

N: The quantity specified by the Quantity of Registers.

*2:

Transmitted by the order: Upper- Lower from the specified

Starting Address.

E.g. 10 in FLOAT format, Transmit order is as

0x41200000.

5.4.5 05 (0x05) Write Single Coil

Write data to Coil of Specified Output Address.

Corresponding to Broadcast.

Request

Items

Size [byte]

Data

Address

1

1 to 247

Function code

1

0x05

Output Address

2

0x0000 to 0xFFFF

Output Value

2

0x0000 or 0xFF00

*1

CRC

2

-

*1:

OFF; 0x0000, ON; 0xFF00

Response

Items

Size [byte]

Data

Address

1

1 to 247

Function code

1

0x05

Output Address

2

0x0000 to 0xFFFF

Output Value

2

0x0000 or 0xFF00

CRC

2

-

This manual is related to the following products: