2 message structure, Message structure, Data link layer – Nor-Cal SDC15 Controller User Manual
Page 161: 7 - 2 message structure
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 communications such as
the destination of the communications 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 (9) 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.
■
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 stands by for reception of STX.
• Number of word addresses accessible by a single frame
7-3
Chapter 7. CPL COMMUNICATIONS FUNCTIONS
02H
58H
0DH
03H
STX
X
ETX
0AH
CR LF
(2)
(1)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
Data link layer
Application layer
Data link layer
1 frame
(1) STX (start of message)
(2) Station address
(3) Sub-address
(4) Device ID code
(5) Send message = command,
response message = response
(6) ETX (end of command/response)
(7) Checksum
(8) CR (delimiter)
(9) LF (delimiter)
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