Energy management
EM24-DIN Communication Protocol
4
Response frame (incorrect action)
Description
Length
Value
Note
Physical address
1 byte
1 to F7h (1 to 247)
Function code
1 byte
83h
Exception code
1 byte
01h, 02h, 03h, 04h (see note)
CRC
2 bytes
Possible exception :
01h: illegal function
02h: illegal data address
03h: illegal data value
04h: slave device failure
1.2.2
Function 04h (Read Input Registers)
This function code is used to read the contents of a contiguous block of input registers (word). The
Request frame specifies the starting register address and the number of registers to be read. It is
possible to read maximum 11 register (word) with a single request, when not differently specified.
The register data in the response message are packed as two bytes per register (word), with the binary
contents right justified within each byte. For each register, the first byte contains the high order bits
(MSB) and the second contains the low order bits (LSB).
Request frame
Description
Length
Value
Note
Physical address
1 byte
1 to F7h (1 to 247)
Function code
1 byte
04h
Starting address
2 bytes
0000h to FFFFh
Byte order: MSB, LSB
Quantity of registers (
N
word)
2 bytes
1 to 10h (1 to 11)
Byte order: MSB, LSB
CRC
2 bytes
Response frame (correct action)
Description
Length
Value
Note
Physical address
1 byte
1 to F7h (1 to 247)
Function code
1 byte
04h
Quantity of requested bytes
1 byte
N
word * 2
Register value
N
*2 bytes
Byte order: MSB, LSB
CRC
2 bytes
Response frame (incorrect action)
Description
Length
Value
Note
Physical address
1 byte
1 to F7h (1 to 247)
Function code
1 byte
84h
Exception code
1 byte
01h, 02h, 03h, 04h
CRC
2 bytes
Possible exception :
01h: illegal function
02h: illegal data address
03h: illegal data value
04h: slave device failure
1.2.3
Function 06h (Write Single Holding Register)
This function code is used to write a single holding register. The Request frame specifies the address of
the register (word) to be written and its content.
The correct response is an echo of the request, returned after the register content has been written.
Request frame
Description
Length
Value
Note
Physical address
1 byte
1 to F7h (1 to 247)
Function code
1 byte
06h
Starting address
2 bytes
0000h to FFFFh
Byte order: MSB, LSB
Register value
2 bytes
0000h to FFFFh
Byte order: MSB, LSB
CRC
2 bytes
Response frame (correct action)
Description
Length
Value
Note
Physical address
1 byte
1 to F7h (1 to 247)
Function code
1 byte
06h
Starting address
2 bytes
0000h to FFFFh
Byte order: MSB, LSB
Register value
2 bytes
0000h to FFFFh
Byte order: MSB, LSB
CRC
2 bytes