Appendix a: modbus protocol, Implementation basics, Modbus rtu message format – GE Industrial Solutions POWER LEADER ModBus Monitor User Manual

Page 55: Appendix a – modbus rtu protocol, Power leader modbus monitor

Advertising
background image

POWER LEADER Modbus Monitor

Appendix A – Modbus RTU Protocol

49

Appendix A:

Modbus Protocol

Implementation Basics

The Modbus Monitor implements a subset of the
Modicon Modbus RTU protocol standard. Modbus is a
master-slave protocol, which means that a single
host/master device initiates and controls all
communication with the other devices on the network.
For the Modbus Monitor, this would be either a second
Modbus Monitor acting as master, or a computer running
PMCS.

NOTE: The POWER LEADER Modbus Monitor is
compatible only with GE Power Management Control
System software, version 6.0 or greater. It is not certified
to be compatible with any other host software.

The hardware interface is implemented as 2-wire RS-
485. In a 2-wire link, data is transmitted and received
over the same lines. In such a half-duplex link, data is
transmitted and received in separate time slices. Also,
per the EIA-485 standard, the number of devices that can
be connected on a single communication channel is
limited to 32 (including the master). Please refer to
GEH-6502, PMCS Network Architecture Guide and the
EIA-485 standard for complete details of the physical
interface including cabling, termination, and shielding.

Modbus RTU 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:

SLAVE ADDRESS

1 byte

FUNCTION CODE

1 byte

DATA

N bytes

CRC

2 bytes

DEAD TIME

3.5 bytes transmission time

These parts are described in detail below:

1. Device Address – This is the first byte of each Modbus
RTU transmission. The device address is a number limited
to the range of 0-247 and is associated with a single device
configured with a matching address. This device receives
and processes the transmission from the master. Only the
addressed slave device responds to a transmission beginning
with this address.

Note that a Device Address of 0 indicates a broadcast
command. The broadcast command is not recognized or
supported by the Modbus Monitor.

2. Function Code – This is the second byte of each
transmission and represents the commanded action to the
slave device (for queries from the master) or the action that
was taken by the slave device (for responses from the slave).
Codes between 1 and 127 are defined as Modbus RTU
functions.

If a slave device responds with a function code with the most
significant bit (MSB) equal to 1 (or equivalently a function
code greater than 127), then the slave device did not perform
the commanded action and is signaling an error response.

3. Data – This field contains a variable number of bytes,
depending on the function performed. Data may contain
addresses, actual values, or setpoints.

4. CRC – This is a 2-byte error-checking code, known as a
Cyclic Redundancy Check. The Modbus RTU standard
requires each message to have a two-byte CRC (commonly
known as CRC-16 for 16 bits of error checking) to be
appended to every transmission.

If the Modbus Monitor detects a CRC error in a received
Modbus message, the Monitor does not respond to the
message. An error in the CRC calculation indicates that
one or more bytes of the transmission were received
incorrectly, so the entire transmission is ignored,
preventing an unintended operation.

The CRC-16 calculation is an industry standard method
used for error detection. An algorithm is included here to
assist programmers in situations where no standard
CRC-16 calculation routines are available.

Advertising