5 description of rtu codes – TOHO ELECTRONICS TTM200 User Manual

Page 20

Advertising
background image

20

6.5 Description of RTU codes

 The codes from a) slave address to b) function code to h) error code shown below are expressed

in 8-bit binary numbers.

a) Slave address

This is the address of the party (this product) with which the high-level computer
communicates. The address in the response message from this product represents the source
of the response message.

b) Function code

Enter a code 03H or 10H.

03H: To read data from this product
10H: To write or store data in this product

c) Register address

The locations of the data to be read or that to be written are specified in 2 bytes.

For the addresses of the commands, see "10. Table of identifiers (codes)."

The data is written in the holding register.

d) Number of registers

This specifies the number of registers to be written in. Since this product has a fixed number
of registers (which is 2), specify 0002H.

e) CRC-16

This error check code is for detecting message errors. This transmits a CRC-16 (tour
redundancy code).

The multinomial for generating a CRC-16 used in this product is X

16

+X

15

+X

2

+1.

To learn how to calculate the CRC-16, see "6.7 Example of CRC-16 calculations."

To affix an error code at the end of the message, affix the low-level byte first, then the
high-level byte of the CRC.

f)

Number of byte

This specifies the number of registers to be read and written x 2. Since the number of
registers in this product is fixed at 2, specify 04H here.

g) Data portion

This specifies data to be written in the register. The data is fixed at 4 bytes. This product
will write data without the decimal point.

Example: In the case of numerical data

Example

Significance of the value

Proportional band (P) = 1.0 %

0 0 0 0 0 0 0 A H

PV = 1200.0

C

0 0 0 0 2 E E 0 H

SV = -10.00

C

F F F F F C 1 8 H

Example: In the case of text data

Example

Significance of the value

Priority screen01=” INP”

20494E50h

Priority screen02=” MV1”

204D5631h

Priority screen02=” P1”

20205031h

In the case of text data, write the ASCII code "□INP" (□ is a space): 20494E50

Advertising