Function codes, A series – GE Industrial Solutions A Series Lighting Control Panelboards Modbus Register Map User Manual

Page 8

Advertising
background image

A Series

®

Lighting Controller Modbus Register Map

Introduction

2

Message Format


The Modbus RTU Protocol is strictly based upon a
transaction scheme where a master device generates a
query and a slave device replies with a response. Each
query and response message transaction consists of the
following four parts

MODBUS ADDRESSES

The master device addresses a specific slave device by
placing the 8-bit slave address in the address field of the
message (RTU Mode). The address field of the message
frame contains two characters (in ASCII mode), or 8
binary bits (in RTU Mode). Valid addresses are from 1-
247.
When the slave responds, it places its own address in this
field of its response to let the master know which slave is
responding.

MODBUS FUNCTIONS

The function code field of the message frame will
contain two characters (in ASCII mode), or 8 binary bits
(in RTU Mode) that tell the slave what kind of action to
take. Valid function codes are from 1-255, but not all
codes will apply to a module and some codes are reserved
for future use.

MODBUS DATA FIELD

The data field provides the slave with any additional
information required by the slave to complete the action
specified by the function code. The data is formed from a
multiple of character bytes (a pair of ASCII characters in
ASCII Mode), or a multiple of two hex digits in RTU
mode, in range 00H-FFH. The data field typically
includes register addresses; count values, and
written data. If no error occurs, the data field of a
response from a slave will return the requested data. If an
error occurs, the data field returns an exception code that
the master's application software can use to determine the
next action to take.

CRC Error Checking

RTU Mode message frames include an error checking
method that is based on a Cyclical Redundancy Check
(CRC). The error-checking field of a message frame
contains a 16-bit value (two 8-bit bytes) that contains the
result of a Cyclical Redundancy Check (CRC) calculation
performed on the message contents.


The checksum field lets the receiving device determine if
a packet is corrupted with transmission errors. In Modbus
RTU mode, a 16-bit Cyclic Redundancy Check (CRC-16)
is used. The sending device calculates a 16-bit value, based
on every byte in the packet, using the CRC-16 algorithm.
The calculated value is inserted in the error check field.

The receiving device performs the calculation, without the
error check field; on the entire packet it receives. The
resulting value is compared to the error check field.

Transmission errors occur when the calculated checksum
is not equal to the Checksum stored in the incoming
packet. The receiving device ignores a bad packet.

Function Codes

The Lighting Controller operating as a Modbus slave uses
the function codes listed in Table 1.

Diagnostics

Diagnostics are supported by the Modbus protocol with
the following three methods:

• Exception Responses – When a failure occurs a

diagnostic value is returned, otherwise an
acknowledgement is returned.

• Read Exception Status – Hardware-specific coil values

that can be read and interpreted.

• Function 08 –Formal layout of reporting statistics and

problems.

The Lighting Controller only supports exception
responses. These occur when a message is received by the
Modbus slave, but the device was unable to answer due to
a problem with the message, such as a request for a
register that does not exist. Thorough reporting of
problems is important for development, support, and use
of the product. There are eight exception codes that are
provided by the Modbus protocol. The remaining values
in the exception byte can be assigned arbitrarily.

If the slave receives a message without a communication
error, but is unable to process it, the slave returns an
exception response to inform the master of the error. The
high-order bit is set in the function code and returned
with the characterizing exception response code, as listed
in Table2.


Advertising