Detailed Descriptions Of Services; Read Variable Area - Omron KM50 Communications Manual

Smart power monitor
Table of Contents

Advertisement

4. 4 Detailed Descriptions of Services

■ Read Variable Area

To read from the variable area, set the required data in the command frame, as shown in the
following diagram.
Command Frame
Slave
Function
address
code
03 hex
1
1
(Numbers below the frame are the number of bytes.)
Name
Slave address
Function code
Read start address
Number of elements
CRC-16
Response Frame
Slave
Function
address
code
03 hex
1
1
Name
Slave address
Function code
Byte count
Number of elements
CRC-16
Read start
No. of elements
address
2
Specify the unit number of the KM50-C/-E.
The slave address can be set to between 01 and 63 hex (1 and 99).
The function code for Read Variable Area is 03 hex.
Specify the address containing the data to be read.
Refer to 5.1 Variable Area for the addresses.
Specify two times the number of data items as the number of elements to be
read.
The setting range for the number of elements is 0002 to 0014 hex (2 to 20).
This check code is calculated with the data from the slave address to the end of
the data.
For details on the CRC-16 calculation, refer to CRC-16 Calculation Example on
page 4-3.
Byte
Data 1
count
Upper bytes
No. of elements × 4 bytes
1
Data n
Data n
Lower bytes
Upper bytes
The value from the command frame is entered as-is.
This is the received function code.
However, a hexadecimal value of 80 hex is added to indicate that the
response is an error response.
Example: Received function code = 03 hex
Function code in the response frame when an error occurred = 83 hex
Gives the number of bytes of read data.
Gives the number of data items that were read.
This check code is calculated with the data from the slave address to the
end of the data.
For details on the CRC-16 calculation, refer to CRC-16 Calculation
Example on page 4-3.

4. 4 Detailed Descriptions of Services

CRC-16
2
2 bytes
Description
Read data
Data 1
Lower bytes
CRC-16
2
Description
4-7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents