beautypg.com

1 general modbus™ description, 1 modbus™ exceptions – Detcon RXT-320 User Manual

Page 23

background image

RXT-320 Wireless Modbus

RXT-320 Wireless IM

Rev. 2.1

Page 19 of 27

4.1

General Modbus™ Description

The RXT-320 performs Modbus™ communication using the RTU transmission mode per the Modbus™
specification. The basic frame format for Modbus™ consists of a Modbus™ address, function code, data and
CRC.

Address Field

Function Code

Data

CRC

Figure 15 ModbusFrame Format

As stated earlier, the Address Field is the unique Modbus™ address of each device for the whole system. The
Function Code is the function to be performed.

The Data contains read or write data and is formatted

according to the function being performed. The CRC (Cyclic Redundancy Code) is used to detect errors in the
frame. Frames with errors are invalid and ignored.

Modbus™ transactions consist of both a request by the controller and response from the device being
addressed so there are two frames transferred for every transaction. Every request is evaluated by the RXT-
320 to determine if it is addressed to it and whether it falls within the register address range. If these two
conditions are true, the RXT-320 will then check to see if it is a valid Function Code. Function Codes
supported by the RXT-320 are:

Function Code 03 (03h) – Read Holding Registers
Function Code 06 (06h) – Write Single Register
Function Code 16 (10h) – Write Multiple Registers

If an invalid function code is performed, then the RXT-320 will ignore the request by default and the
controller will timeout and continue with the next transaction.

4.1.1

Modbus™ Exceptions

The RXT-320 is capable of returning Modbus™ exceptions when it cannot service a Modbus™ request meant
for that RXT-320. By default this is turned off since it can cause issues with some controllers that do not
process Modbus™ exceptions. The following exception codes are supported and returned when Modbus™
exceptions are enabled:

Table 6 Exception Codes

Exception

Code

Name

Meaning

01

Illegal Function

Unsupported function code. Only 03, 06 and 16 are
supported.

02

Illegal Data Address

The registers being requested falls only partially within the
valid RXT-320 register ranges. For example, the RXT-320
registers start at 8192. If an access is perform requesting
registers 8191 to 8192 then this is an Illegal Data Address
since 8191 does not fall completely within the valid register
range. This would not be an exception though if register
address 8190 to 8191 were used – this would be passed on
to the Modbus™ interface for a local device to respond.

There are other exception codes defined in Modbus™ but these are the only ones returned by the RXT-320.