Siemens NAN 67 Series Manual de usuario Pagina 31

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 76
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 30
Modbus RTU Exception Codes
02/13 Modbus® RTU Serial Communications User Manual 25
4. Modbus RTU Exception Codes
Introduction
When a master device sends a query to a slave device it expects a normal response. One of four possible
events can occur from the master’s query:
Slave device receives the query without a communication error and can handle the query normally.
It returns a normal response.
Slave does not receive the query due to a communication error.
No response is returned. The master program will eventually process a time-out condition for the
query.
Slave receives the query but detects a communication error (parity, LRC or CRC).
No response is returned. The master program will eventually process a time-out condition for the
query.
Slave receives the query without a communication error but cannot handle it (i.e., request is to a non-
existent coil or register).
The slave will return with an exception response informing the master of the nature of the error (Illegal
Data Address.)
The exception response message has two fields that differentiate it from a normal response:
Function Code Field:
In a normal response, the slave echoes the function code of the original query in the function code
field of the response. All function codes have a most-significant bit (MSB) of 0 (their values are below
80 hex). In an exception response, the slave sets the MSB of the function code to 1. This makes the
function code value in an exception response exactly 80 hex higher than the value would be for a
normal response.
With the function code’s MSB set, the master’s application program can recognize the exception
response and can examine the data field for the exception code.
Data Field:
In a normal response, the slave may return data or statistics in the data field. In an exception response,
the slave returns an exception code in the data field. This defines the slave condition that caused the
exception.
Query
Example:
Internal slave error reading 2 registers starting at address 1820h from slave at slave address 02.
02 03 18 20 00 02 CRC CRC
Response
Example:
Return MSB in Function Code byte set with Slave Device Failure (04) in the data field.
83 04 CRC CRC
Vista de pagina 30
1 2 ... 26 27 28 29 30 31 32 33 34 35 36 ... 75 76

Comentarios a estos manuales

Sin comentarios