Function 04H (Read Input Registers); Function 06H (Write Single Holding Register) - CARLO GAVAZZI EM21 - COMMUNICATION PROTOCOL V1 REV0 Communication Protocol Manual

Table of Contents

Advertisement

Energy management
Response frame (incorrect action)
Description
Physical address
Function code
Exception code
CRC
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
Physical address
Function code
Starting address
Quantity of registers (N word)
CRC
Response frame (correct action)
Description
Physical address
Function code
Quantity of requested bytes
Register value
CRC
Response frame (incorrect action)
Description
Physical address
Function code
Exception code
CRC
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
Physical address
Function code
Starting address
Register value
CRC
Response frame (correct action)
Description
Physical address
Function code
Starting address
Register value
CRC
EM24-DIN Communication Protocol
Length
Value
1 byte
1 to F7h (1 to 247)
1 byte
83h
1 byte
01h, 02h, 03h, 04h (see note)
2 bytes
Length
Value
1 byte
1 to F7h (1 to 247)
1 byte
04h
2 bytes
0000h to FFFFh
2 bytes
1 to 10h (1 to 11)
2 bytes
Length
Value
1 byte
1 to F7h (1 to 247)
1 byte
04h
1 byte
N word * 2
N*2 bytes
2 bytes
Length
Value
1 byte
1 to F7h (1 to 247)
1 byte
84h
1 byte
01h, 02h, 03h, 04h
2 bytes
Length
Value
1 byte
1 to F7h (1 to 247)
1 byte
06h
2 bytes
0000h to FFFFh
2 bytes
0000h to FFFFh
2 bytes
Length
Value
1 byte
1 to F7h (1 to 247)
1 byte
06h
2 bytes
0000h to FFFFh
2 bytes
0000h to FFFFh
2 bytes
Note
Possible exception :
01h: illegal function
02h: illegal data address
03h: illegal data value
04h: slave device failure
Note
Byte order: MSB, LSB
Byte order: MSB, LSB
Note
Byte order: MSB, LSB
Note
Possible exception :
01h: illegal function
02h: illegal data address
03h: illegal data value
04h: slave device failure
Note
Byte order: MSB, LSB
Byte order: MSB, LSB
Note
Byte order: MSB, LSB
Byte order: MSB, LSB
4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the EM21 - COMMUNICATION PROTOCOL V1 REV0 and is the answer not in the manual?

This manual is also suitable for:

Em21Em24 din

Table of Contents