4 error check (checksum) field, 4 packet communications for the ld5200, 1 function 03: read output registers – RLE LD5200 V.2.3 User Manual

Page 87: Error check (checksum) field, Packet communications for the ld5200, Function 03: read output registers, Table 5.1, Exception codes, Table 5.2, Read output registers packet structure

Advertising
background image

rletech.com

LD5200 User Guide

87

5

Modbus Communication

5.3.1.4 Error Check (Checksum) Field

The checksum field lets the receiving device determine if the packet has transmission errors.

The LD5200 RTU mode uses a 16-bit cyclic redundancy check (CRC-16).

Exception Responses

If a Modbus master sends an invalid command to the LD5200 or attempts to read an invalid

register, an exception response is generated. The response packet will have the high order bit

of the function code set to one. The data field of the exception response contains the exception

error code.

5.4

Packet Communications For The LD5200

This section covers the registers, their names, and a brief description of what they refer to.

5.4.1 Function 03: Read Output Registers

To read the LD5200 parameter values, the master must send a Read Output Registers request

packet. The Read Output Registers request packet specifies a start register and the number of

registers to read. The start register is numbered from zero (40001 = zero, 40002 = one, etc).

Code Name

Description

01

Illegal Function

The function code is not supported

02

Illegal Data Address

Attempt to access an invalid address

03

Illegal Data Value

Attempt to set a variable to an invalid value

Table 5.1

Exception Codes

Read Registers Request Packet

Read Registers Response Packet

Slave Address (1 byte)

Slave Address (1 byte)

03 (Function code) (1 byte)

03 (Function code) (1 byte)

Start Register (2 bytes)

Byte count (1 byte)

# of registers to read (2 bytes)

First register (2 bytes)

Crc Checksum (2 bytes)

Second register (2 bytes)

Crc Checksum (2 bytes)

Table 5.2

Read Output Registers Packet Structure

Advertising