Function code field, Data block field, Error check field – Basler Electric DECS-400 User Manual

Page 216: Modbus modes of operation, Serial transmission details

Advertising
background image

204

9369700990 Rev R

Modbus protocol limits a device address from 1 to 247. The address is user selectable at installation, and
can be altered during real-time operation.

Function Code Field

The function code field in the query message defines the action to be taken by the addressed slave. This
field is echoed in the response message, and is altered by setting the most significant bit (MSB) of the
field to 1 if the response is an error response. This field is 1 byte.

The DECS-400 maps all registers into the Modicon 984 holding register address space (4XXXX) and
supports the following function codes.

READ OUTPUT REGISTERS (function code 3),

PRESET MULTIPLE REGISTERS (function code 16), and

LOOPBACK DIAGNOSTIC TEST (function code 8) with diagnostic sub-functions:

Return Query Data (diagnostic code 0),

Restart Comm. option (diagnostic code 1), and

Force Slave To Listen Only Mode (LOM, diagnostic code 4).

DECS-400 Modbus performs all of the above functions when a Modbus message has its unique address
which is numbered from 1 to 247. The DECS-400 also recognizes a broadcast (group) address of 0. Only
functions 16 and 8 are recognized as valid for broadcast. The DECS-400 does not send a response
message for a broadcast query.

In listen-only mode (LOM), received data is monitored (but no responses are transmitted). The only query
that will be recognized and processed while in LOM is a maintenance restart command (function code 8,
diagnostic code 1).

Data Block Field

The query data block contains additional information needed by the slave to perform the requested
function. The response data block contains data collected by the slave for the queried function. An error
response will substitute an exception response code for the data block. The length of this field varies with
each query. See the paragraphs on Register Definitions in this manual for interpretation of register data.

Error Check Field

The error check field provides a method for the slave to validate the integrity of the query message
contents and allows the master to confirm the validity of response message contents. This field is 2 bytes.

Modbus Modes of Operation

A standard Modbus network offers one of three possible transmission modes for communication: ASCII,
remote terminal unit (RTU), or Modbus/TCP. The DECS-400 supports the RTU and Modbus/TCP modes
depending on the communication option selected. For example, the TCP mode is employed when the
Modbus/TCP setting is Enabled in BESTCOMS. Modbus communication over the RS-485 port is disabled
when Modbus TCP is enabled. To enable Modbus over the RS-485 port, the Modbus/TCP setting in
BESTCOMS must be disabled. ASCII mode is not supported by the DECS-400.

Serial Transmission Details

Communication settings for the DECS-400 rear RS-485 port are listed in Table 25. The baud rate, data
size, parity, stop bits and Modbus slave address are only for the RS-485 interface and are not used when
the Modbus/TCP mode is enabled.

Table 25. DECS-400 Communication Settings

Setting

Programmable

Y (Yes)/N (No)

Default Value

Value Range

Baud rate

Y

9600

4800, 9600, or 19200

Data Size (in bits)

N

8

N/A

Modbus™ Communication

DECS-400

Advertising