beautypg.com

External device setup manual – IDEC High Performance Series User Manual

Page 640

background image

Chapter 5

622

External Device Setup Manual

4. Functions

The following section describes the details of the functions.
The communication example listed for each function is only for the 7th and later bytes of the data.
Refer to the description of the basic format and add bytes 0 to 6 in the actual communications.

- FC3 Read multiple registers - Reading of Holding Register (HR) consecutively

- FC16 Write multiple registers - Writing to Holding Register (HR) consecutively

The MICRO/I or Touch supports the following functions.

Function
code

Function name

Description

3

Read multiple registers

Reading of Holding Register (HR) consecutively

16 (10Hex)

Write multiple registers

Writing to Holding Register (HR) consecutively

1

Read coils

Reading of Coil (C) consecutively

2

Read discrete inputs

Reading of Input Relay (I) consecutively

4

Read input registers

Reading of Input Register (IR) consecutively

5

Write coil

Writing to a single Coil (C)

6

Write single register

Writing to a single Holding Register (HR)

7

Read exception status

Reading of exception status (0 to 7th bit of HR400001)

Request

Byte 7

FC (Function code) = 03

Byte 8-9

Reference No.

Byte 10-11

Number of read words (1 to 125 words)

Normal response

Byte 7

FC (Function code) = 03

Byte 8

Number of bytes of the response (number of read words x 2)

From Byte 9

Read data

Abnormal response

Byte 7

FC (Function code) = 83 (HEX)

Byte 8

Exception code 01 or 02

Example

Reading of HR400001 (1 word). The read value is 1234 (HEX).

03 00 00 00 01 => 03 02 12 34

Request

Byte 7

FC (Function code) = 10 (HEX)

Byte 8-9

Reference No.

Byte 10-11

Number of write words (1 to 100 words)

Byte 12

Number of write bytes (2 x number of write words)

From Byte 13

Write data

This manual is related to the following products: