7-3
Chapter 7. CPL COMMUNICATION FUNCTION
7 - 2 Message Structure
Message structure
The following shows the message structure:
Messages are broadly classified into two layers; the data link layer and the
application layer.
• Data link layer
This layer contains the basic information required for the communication such
as the destination of the communication message and the check information of
the message.
• Application layer
Data is read and written in this layer. The content of the layer varies according
to the purpose of the message.
Messages comprise parts (1) to (8) as shown in the figure below.
The command (details sent from the master station) and the response (details
returned from the slave station) are stored in the application layer.
02H
58H 0DH03H
STX
X ETX
0AH
CR LF
(2)(1) (3) (4) (5) (6) (7) (8)
Data link layer Application layer Data link layer
1 frame
(1) STX (start of message)
(2) Station address
(3) Sub-address
(4) Device code
(5) Send message = command,
response message = response
(6) ETX (end of command/response)
(7) Checksum
(8) Delimiter (end of message)
Data link layer
Outline
The data link layer is of a fixed length. The position of each data item and the
number of its characters are already decided. Note, however, that the data positions
of the data link layer from ETX onwards shift according to the number of characters
in the application layer. The character length, however, remains unchanged.
Response start conditions
• The device sends the response message only when (1) message structure, station
address, sub-address, checksum and message length of a single frame in the data
link layer are all correct. If even one of these is incorrect, no response messages
are sent, and the device waits for new message.
• Number of word addresses accessible by a single frame
Type Description of command RAM area EEPROM area
RS Decimal format read command 16 16
WS Decimal format write command 16 16
RD Hexadecimal format read command 28 28
WD Hexadecimal format write command 27 16
RU Hexadecimal format random read command 28 28
WU Hexadecimal format random write command 14 14