10 description of ascii codes – TOHO ELECTRONICS TTM200 User Manual

Page 26

Advertising
background image

26

6.10 Description of ASCII codes

 The codes from a) start code to b) slave address to j) error type described below are expressed

in ASCII codes.

 For ASCII codes, see "11. Table of ASCII codes."
 For converting to ASCII codes, see 6.8 and 6.9 "Message composition."

a) Start code

The receiver side is the code required for detecting the top of the message. It is affixed to
the top of a character string to be transmitted.

b) 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. Note that, when CH2 is used, 2 addresses are occupied.
(When the ADR is set to 1, addresses 1 and 2 are occupied.)

c) Function code

Enter a code 03H or 10H.

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

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) 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)."

f)

LRC

LRC is an error check code for detecting message errors. An LRC is transmitted. The LRC
used in this product is the 2-complement of the sum of the data portions without a carry,
except for the start code and end code of the message.

The parts of the data portions expressed as a "1" and "B" are considered as "1BH."

To learn how to calculate the LRC, see "6.12 Example of LRC calculations."

If 12H is calculated as an error code, affix a "1" or "2" at the end of the message.

g) End code

This code is required for the receiver to detect the end of a message. Affix CR (0DH) and
LF (0AH) at the end of a character string to be transmitted.

h) 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.

i)

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

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

Advertising