Write Variable Area - Omron KM50 Communications Manual

Smart power monitor
Table of Contents

Advertisement

■ Write Variable Area

To write data to the variable area, set the required data in the command frame, as shown in the
following diagram.
Execute this service after changing to a Setting Mode.
• Command Frame
Slave
Function
Write start
code
address
address
10 hex
1
1
Slave address
Function code
Write start address
Number of elements
Byte count
CRC-16
• Response Frame
Slave
Function
address
code
10 hex
1
1
Slave address
Function code
Write start address
Number of elements
CRC-16
No. of
elements
2
2
Name
Specify the unit number of the KM50.
The slave address can be set to between 01 and 63 hex (1 and 99).
The function code for Write Variable Area is 10 hex.
Specify the starting address where the data will be written.
Refer to 5.1 Variable Area for the addresses.
Specify two times the number of data items as the number of elements
to be written.
The range is 0002 to 0014 hex (2 to 20).
Specify the number of bytes of write data.
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.
No. of
Write
elements
start
dd
2
Name
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 = 10 hex
Function code in the response frame when an error occurred = 90 hex
This is the received write start address.
This is the received number of elements.
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
Write data
Byte
Data 1
count
Upper bytes
Lower bytes
No. of elements × 4 bytes
1
Data n
Data n
Upper bytes
Lower bytes
Description
CRC-16
2 bytes
2
Description
Data 1
CRC-16
2
4-9

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents