TOHO ELECTRONICS TTX-700 User Manual

Page 30

Advertising
background image

6.10 Description of ASCII codes

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

in ASCII codes.

n For ASCII codes, see "9. Table of ASCII codes."
n 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 data

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






30

Advertising