LXM32M

3 Basics

 

 

3.4.2"Function Code" 8 (Diagnostics)

This "Function Code" 8 (Diagnostics) allows you to read diagnostics data of the slave.

Modbus request Structure of the Modbus request:

Field

Bytes

Value

Meaning

 

 

 

 

Function Code

1

8 = 08h

Diagnostics

 

 

 

 

Sub-function Code

2

(various)

Diagnostics function

 

 

 

 

Data

2

(various)

Data (depending on diagnostics function)

 

 

 

 

Modbus response Structure of the positive Modbus response:

Field

Bytes

Value

Meaning

 

 

 

 

Function Code

1

8 = 08h

Diagnostics

 

 

 

 

Sub-function Code

2

(various)

Diagnostics function

 

 

 

 

Data

2

(various)

Diagnostics data

 

 

 

 

Structure of the negative Modbus response

Field

Bytes

Value

Meaning

 

 

 

 

Function Code

1

08h + 80h = 88h

Diagnostics

 

 

 

 

Exception Code

1

01h ... 04h

See chapter

 

 

 

"3.3.2 Modbus response to a Modbus request"

 

 

 

 

Sub-function Code The following diagnostics functions are available:

 

Sub-function Code

Diagnostics function

 

 

 

 

 

00

Return Query Data

Return request as a response

 

 

 

 

 

01

Restart Communication Option

Re-initialize the communication port

 

 

 

 

 

02

Return Diagnostic Register

Return the error number in the case of synchronous errors

 

 

 

 

 

03

(reserved)

 

 

 

 

 

04

Force Listen Only Mode

Force "Listen Only" mode

 

 

 

 

 

05 ... 09

(reserved)

 

 

 

 

 

10

Clear Counters and Diagnostic

Clear all statistical counters

 

 

Register

 

 

 

 

 

 

11

Return Bus Message Count

Return number of detected "Bus Message"s

 

 

 

 

 

12

Return Bus Communication

Return number of detected "Bus Communication Error"s

 

 

Error Count

 

 

 

 

 

 

13

Return Bus Exception Error

Return number of detected "Bus Exception Error"s

 

 

Count

 

 

 

 

 

 

14 ... 15

(reserved)

 

 

 

 

 

16

Return Slave NAK Count

Return number of detected "Slave Not-Acknowledged"s

 

 

 

 

01.2012

17

Return Slave Busy Count

Return number of detected "Slave Busy"s

 

 

 

18

Return Bus Char Overrun

Return number of detected "Bus Char Overrun"s

 

0198441113843, V1.01,

 

Count

 

 

 

 

>18

(reserved)

 

 

 

 

 

 

Modbus-TCP module

29

Page 29
Image 29
Schneider Electric LXM32M manual Function Code 8 Diagnostics, Sub-function Code Diagnostics function