Modbus Gateway User Manual
Modbus Gateway User Manual
User Manual
(3.30 Release 3 Firmware)
Page 2 of 38
Table Of Contents
Table Of Contents
TABLE OF CONTENTS
IMPORTANT INFORMATION
14
38
Page 3 of 38
Page 4 of 38
Introduction
Introduction
Many of Deltas Controllers have an ordering option that allows them to
function as a Modbus master device and communicate with one or more Modbus
slave devices. This allows the controller to act as a Gateway translating
information to/from the Modbus slave device(s) into BACnet objects resident in
the Gateway controller, which can then be accessed by the rest of the BACnet
network.
The Delta Modbus Gateway controllers communicate to Modbus slave devices
using the Modbus RTU protocol via its NET (RS-485) or PTP (RS-232) ports.
Important Information
When entering data into the Gateway Translation object (GWT) dataview do not
use the insert or delete keys to insert or delete an entry in the dataview. There is
currently a bug with this functionality in the GWT object that will result in the
object being corrupted. This will be fixed in a future revision of the Modbus
Gateway firmware.
Description
BACnet Router w/ Modbus Gateway
16 Button Room Controller w/ Modbus
16 Button Room Controller w/ Modbus
16 Button Room Controller w/ Modbus
Room Controller w/ Modbus Power Meter Interface
Modbus
Units
30
52
15 2
30
1
1. This column lists the current number of Modbus slave devices supported by the associated controller.
2. Gateways not already maxed out to 30 can be flash loaded in the field to support additional Modbus units, up to 30.
Page 5 of 38
Modbus Controllers
Almost any Delta I/O controller installed to control some mechanical equipment
can be loaded with the Modbus interface to pick up a few Modbus devices or
units (i.e., variable speed drives) as part of the same mechanical system.
However, in contrast to the Gateway products, these controllers cannot be
ordered with Modbus preloaded on them. Rather, order whatever DAC or DSC
product you will be using (with the appropriate I/O for the mechanical system),
and then load the Modbus interface in the field for the number of Modbus units
(or devices) you will be connecting to, up to a maximum of 5 Modbus units per
controller. Please note below the two criteria needed in order to load Modbus.
DCU firmware
DAC/DSC/DSM/DLC/ASM firmware
Modbus Gateway Interface and units
BACstats FUTURE (when a new flash loadable model is released)
Modbus can be loaded into any Delta product that meets the following criteria.
1.
2.
Particularly for DAC models, the controller hardware must be one of the
more recent revisions that have the larger memory (shipped in a box with a
green dot on it, and includes a green Product Notice) where flash memory
has been increased to to 1 MB and the SRAM has been doubled to 256K.
Note: You can also determine whether a product has more memory when it is
powered up and communicating by looking at its DEV object using ORCAview.
Any product that includes the underscore as part of its Model Name on the
Product tab (i.e., DAC_322) has the increased memory as required. You can
even create a custom report in ORCAview to list this information and one has
already been provided on GEORGE for download.
The V3.30 Release 3 Flash Loader is rather smart and can figure out what it can
and cannot do with the controller youve connected to, and whether the
controller is one that Modbus can be loaded into, and indicates how many
Modbus units have already been loaded and and whether you can load any more.
Loading Modbus into a controller will use (or decrement) 10 credits off the
Flash Loader key for each Modbus unit. Other product upgrades require a
different number of credits. And once loaded into a Delta product, the credits are
unrecoverable (you cannot reverse the process).
Page 6 of 38
Refer to Flash Loader documentation or the Help file for further information,
including how many credits are used to upgrade all other devices.
Description
DFF099-KEY
DFF099-CDT
NET1
NET2
PTP
Ethernet DSC or
DSM-RTR
LINKnet or
Modbus
BACnet MS/TP
(Subnet Level)
or Modbus
Non-Ethernet DSC
or DSM-T0B or
DSM-PWR
BACnet MS/TP
(System Level)
LINKnet or
Modbus
DAC+
BACnet MS/TP
(Subnet Level)
LINKnet or
Modbus
N/A
*Note: When connecting to a Modbus device using the RS-232 (PTP) port only a single Modbus
slave device is supported. To communicate with multiple devices requires an RS-485 (NET)
connection to the Modbus slave devices.
The diagram on the following page shows how to wire a single Modbus slave
device to a DSM-T0B-MODxx controller using the NET2 port. For more
detailed wiring information refer to the Delta Controls Wiring Guidelines.
Page 7 of 38
Modbus device
Shield connection
(optional)
24VAC (Class 2) or
24VDC power supply
RS485
Communications
port
24VAC or
24VDC (+)
Shield
To previous
controller
on MS/TP
network
To next
controller
on MS/TP
network
Shield
Solidly ground
the shield
RX
TX
RX
Power/NET1
TX
Power/NET2
NET1
TERM
~24
GND
~24
TERM
GND
GND
-+
NET2
Bottom edge
of the DSM
AMP connectors
Note: Use a shielded, twisted pair wire for communications. Never directly ground more than one
point on the shield. Doing so can induce large currents, and result in communication problems.
Page 8 of 38
Communications Settings
The Gateway (GW) object is used to setup the interface between the Gateway
controller and the Modbus device(s). You cannot create the GW object. It is
automatically created in the controller whenever the Modbus Gateway firmware
is present.
To setup the GW object, follow these steps:
1.
Page 9 of 38
2.
Ensure the Enable checkbox is checked and select from the Port drop down
menu which port the Modbus device(s) are physically connected to. Using
the Speed drop down menu select the communications baud rate of the
Modbus device(s). (Refer to documentation that came with the Modbus
device(s) for information on the valid connection speeds for that device.)
3.
Page 10 of 38
1.
Create a GWT object with an instance number equal to the network address
of the Modbus device to be associated with it.
2.
From the documentation that came with the Modbus slave device,
determine if it uses a 0 or 1-based register addressing convention and set the
Register Base Count Field to match. (While Modbus specifies a 1-based
register addressing convention, some implementations use a 0-based
register addressing convention in their documentation of the register
mappings. The Register Base Count field is used to configure the GWT to
be compatible with the convention used by that particular device.)
3.
In the dataview of the GWT object, create an entry for each value from the
Modbus device to be linked to a BACnet object in the Gateway. Start
entering data by double clicking in the column you wish to edit.
4.
Below the dataview there are also several dropdown boxes that contain
more configuration settings for the current selected entry. After filling out
the fields in the dataview for a single entry, you must click on Apply before
you can enter data in these remaining fields. After you finish setting these
additional fields press Apply again to save the changes before moving to the
next entry.
5.
Press the Create BACnet Objects button and press Apply. This will
automatically create all the required BACnet objects based on the object
references and names you entered in the steps above.
Note:
1) If an object reference is already used in the database, the name of the object will not
be overwritten by the GWT object, however a link will still be created to the Modbus
register. If this object was already created because it is being used for some other
purpose in the database, there will be a conflict since there would now be two competing
control sources for the object.
2) Changes to the name or units properties for a given entry in the GWT after the
associated BACnet object (AV, BV or MV) has been created have no effect. Once the
object has been created, any changes to these properties should be done directly in the
object itself.
Page 11 of 38
Bit
1
Bit Value
0-16
1
Integer
N/A
2
Long
N/A
1
Bit Value
0-16
2
Double Integer
N/A
2
Float
N/A
2
FloatSwapped
N/A
2
FloatReversed
N/A
MV
1
Integer
N/A
(For a definition of the different Data Types see the Data Types section of Appendix C)
Examples:
Read a Floating Point Value from Input Register 30002 to AV1
Reference R/W Config. Memory Type Register # of Registers Data Type Bit
AV1
Read
Input Register
2
2
Float
N/A
Read Bit 2 from Input Register 30002 to BV1
Reference R/W Config. Memory Type Register # of Registers Data Type Bit
BV1
Read
Input Register
2
1
Bit Value
2
Page 12 of 38
2.
You cannot use the Bit Value data type when writing to a Holding
register. If you want to write to a single bit in a holding register, you
should read out the register value as an integer into an AV, then use
GCL bit manipulation to set/clear the required bit and write this
adjusted value back into the Modbus device.
Examples:
Read an Integer Value from Holding Register 40001 to AV1
Reference R/W Config. Memory Type Register # of Registers Data Type Bit
AV1
Read
Holding Register
1
1
Integer
N/A
Write the Value from AV3 as a Long to Holding Register 40002
Reference R/W Config. Memory Type Register # of Registers Data Type Bit
AV3
Write
Holding Register
2
2
Long
N/A
Page 13 of 38
Appendices
Appendix A: Troubleshooting
There are several features in this version of the Delta Modbus Gateway that can be used
to help when troubleshooting the data exchange between the Modbus Gateway and its
associated devices.
Page 14 of 38
Appendices
(See Appendix C: Modbus Protocol Implementation for details on the packet structure for
Modbus communications.
Note:
1) Any text already in the description tab when packet sniffing mode is enabled will be
overwritten.
2) For AV objects you must change the units directly in the associated AV object to go to
packet sniffing mode for that entry. For BVs and MVs, which do not have a units field,
change the units property for the associated entry in the GWT object.
Page 15 of 38
Setup
Enable
This checkbox enables or disables the gateway.
Page 16 of 38
Appendices
Version
This field displays the version number of the gateway firmware loaded into the
Delta Controller, which is different from the main firmware version number
listed in the Device object.
Type
This field displays the type of gateway that is loaded into the Delta Controller.
In V3.30A firmware there are only two gateways currently supported:
Modbus
Status
This field displays the status of the gateway. When the gateway is enabled, this
field displays Running. When the gateway is disabled, this field displays
Stopped.
Port
This field is used to select the physical port which is to be connected to the
Modbus slave device(s).
There are three port options available:
* Note:
1) Only DSC and DSM controllers come with a serial port.
2) When connecting via PTP only a single Modbus slave device is supported.
Speed
This field is used to select the baud rate for communicating with the Modbus
slave devices(s). The baud rate must be set to the same speed on both devices in
order that they communicate properly. The supported speeds are 2400, 4800,
9600, 19200, and 38400 baud.
Status
This field displays the current status of the selected port. When the port is being
used by the gateway, this field displays Active. When the gateway is disabled,
this field displays Inactive. If the selected port is in use by something other than
the gateway (i.e. NET object), this field displays "In Use By" and lists the name
of the object using the port.
HVAC, Access, and Lighting Checkboxes
These checkboxes indicate which application(s) the object is part of. Any
combination of the HVAC, Access Control, and Lighting applications can be
selected. Leaving all checkboxes blank is the same as checking them all.
Page 17 of 38
As a part of OWS security, these checkboxes allow an operator to see only the
objects for a particular application(s). For example, a site may have separate
operators for the HVAC and Access applications. It is possible for each
operator to only see the objects related to their application.
Refer to Chapter 7 - Security in the ORCAview Technical Reference Manual
for more information on how to set up and administer Object Application
Restrictions
When a checkbox is checked, an indicator icon appears at the top of the dialog.
The three application domains are:
Application
Icon
HVAC (Red)
Access (Blue)
Lighting (Green)
Statistics
Total Sent
This field displays the total number of Modbus packets sent from the Delta
Controller since the last controller reset. The value of this number is not very
important but it should be continuously incrementing. If the Total Sent is not
incrementing, then it means that no packets are being sent.
Page 18 of 38
Appendices
Total Received
This field displays the total number of packets received from the Modbus
slave(s) since the last controller reset. The value of this field should be
incrementing along with the Total Sent field. If the Total Received is not
incrementing along with the Total Sent field, then it means that the Delta
Controller is sending requests but the Modbus slaves are not responding.
Send Failures
This field displays the total number of sent packets that failed to receive a
response since the last controller reset.
Invalid Received
This field displays the total number of invalid packets received since the last
controller reset. Invalid packets are those that contain an incorrect cyclic
redundancy code (CRC).
A CRC is a number derived from, and transmitted with, a block of data in order
to detect corruption. By recalculating the CRC and comparing it to the value
originally transmitted, the receiver can detect some types of transmission errors.
Protocol Errors
This field displays the total number of exception responses returned since the
last controller reset.
GWT Update Interval
This is the time in seconds that it took on the last iteration to scan all the GWT
objects and update the associated BACnet objects. The update rate varies
depending on the number of Modbus slave devices, and how many values are
mapped from each device.
Programming
The Programming tab is not used for the Modbus Gateway but only with the Delta
Wireless Gateway.
Description
The description tab may contain a string of characters of up to 2000 characters in
length. The character string is limited to any printable character.
Page 19 of 38
The common area of the Setup tab has two fields and a button located above the
dataview area.
Name
The name of the Gateway Translation object is displayed in this field. This
name must be unique among all the descriptors located in the same controller.
Register Base Count
While Modbus specifies a 1-based register addressing convention, some
implementations use a 0-based register addressing convention in their
documentation of the register mappings. The Register Base Count field allows
the GWT object to be compatible with either convention.
For example, the first register in the Holding Registers memory block (also
refered to as 4x references) may be documented any of the following ways:
Page 20 of 38
Appendices
* Note: The leading digit in the last example is used to represent the memory type (in this
case a Holding register) while the remaining digits indicate the register count in a 1based decimal format.
Refer to the Memory Types section of Appendix C and the documentation that
came with the Modbus device(s) to determine which setting to use.
Create BACnet Objects Pushbutton
This button is used to automatically create the objects that are listed in the
Reference column of the dataview if they do not already exist. This button has to
be depressed and the Apply button pressed in order to create the objects.
Setup (Dataview)
The Data View on the Setup tab lists all of the translated information from the
Modbus device.
Clicking on one of the entries will display additional information below the Data
View.
Name
The Name of the BACnet object that is linked to the Modbus register for this
entry.
Page 21 of 38
Reference
The object reference of the associated BACnet object. Only AV, BV, and MV
object references are supported.
Exceptions
A read only field that shows any exception codes returned from the Modbus
device for that entry. Exception codes are error codes returned from a Modbus
slave device in response to a request from the Master device.
Refer to Exception Responses in Appendix C for more information.
Read
When the associated checkbox is checked this indicates that the value is being
read from the Modbus device into the associated BACnet object. Unchecked
indicates the value is being written to the Modbus device. This field is read-only
in the dataview. To change this value you must highlight the desired entry and
use the R/W Configuration drop-down box located below the dataview.
Memory Type
Memory Type determines where the data is stored in the memory of the Modbus
device. Each Memory Type reads or writes to a certain range of memory in the
Modbus device. The different Memory Types and corresponding register
reference are listed below.
Page 22 of 38
Appendices
Page 23 of 38
Scaling/MV Offset
This field is used when mapping a Modbus value to an AV or MV object.
When mapping to an AV object, it can be used to rescale a value from a Modbus
device by doing a left or right shift of up to 4 decimal places. For example, if
the Modbus device returned a value of 600 which represents a value of 60.0Hz,
selecting Div10 from this dropdown would convert the value from 600 to 60.0
before placing it into the associated AV object.
MV objects take an integer value and convert it to a text value based on an
enumeration list in an associated MIC object. The MIC enumeration list is 1
based while some Modbus device enumerations are 0 based. In order to map a 0
based enumeration value from a Modbus device to an MV object, select Div10
(or +1 MV Offset) from the dropdown list.
Register Address
This is a display only field that displays the full decimal and Hexadecimal
Address for the starting register of the data in the Modbus device for the
currently selected dataview entry.
HVAC, Access, and Lighting Checkboxes
These checkboxes indicate which application(s) the object is part of. Any
combination of the HVAC, Access Control, and Lighting applications can be
selected. Leaving all checkboxes blank is the same as checking them all.
As a part of OWS security, these checkboxes allow an operator to see only the
objects for a particular application(s). For example, a site may have separate
operators for the HVAC and Access applications. It is possible for each
operator to only see the objects related to their application.
Refer to Chapter 7 - Security in the ORCAview Technical Reference Manual
for more information on how to set up and administer Object Application
Restrictions
When a checkbox is checked, an indicator icon appears at the top of the dialog.
The three application domains are:
Application
Icon
HVAC (Red)
Access (Blue)
Lighting (Green)
Description
The description tab may contain a string of characters of up to 2000 characters in
length. The character string is limited to any printable character.
Page 24 of 38
Appendices
Name
01
02
03
04
05
06
16
Page 25 of 38
Memory Types
Modbus data values are broken into 4 different memory types each of which represent a
block of memory in the Modbus device. Each of these blocks of memory is broken up
into registers. Depending on the memory type and data format, a single data value will
span 1 or more registers. To access a particular register, both the register number and
memory type must be specified. Together these represent the register address. There are
several different conventions in which register addresses are documented:
For example, the first register in the Holding Registers memory block (also referred to as
4x references) may be documented any of the following ways:
Register 40001
Page 26 of 38
Appendices
Data Types
The data values stored in Modbus registers can be in several formats. You need to know
in what format the information is stored in order to be able to correctly configure the
GWT object to read and/or write that value. This section details the different data
formats supported by the Delta Modbus Gateway.
Bit Value Bit values are stored in a single 1-bit register. They are used to store simple
binary values. (1 = ON, 0 = Off)
Integer This data type uses a 16-bit signed integer format to store a whole number
value from 32768 to 32767. Integer values are stored in a single 16-bit register.
Double Integer The double integer data type spans two 16-bit registers and can store
any positive whole number value from 0 to 4,294,967,295
Long Longs are 32-bit signed Integers. In this data type the most significant bit (MSB)
is used to indicate if the value is positive or negative. The remaining 31 bits are the
binary equivalent of the decimal value. For example, 3 and 3 expressed in Binary Long
format would be:
Decimal Value
3
-3
A Long value spans two 16-bit registers and can store any whole number value from
-2,147,483,648 to +2,147,483,647.
Note: Delta uses a 32-bit (single precision) floating-point format to store BACnet AV
values. This limits the stored value to 6 significant figures plus an exponent value. This
means that when mapping Double Integer and Long values from a Modbus device to
AVs you are actually limited to integer values between 340,282 and +340,282 before
round off errors due to trailing significant figures being dropped occurs.
32-Bit (Single Precision) Floating Point numbers Floating-Point values are used to
represent real numbers (numbers with a fractional component). IEEE specifies a standard
format for 32-bit floating-point values. There are 4 variations in which IEEE FloatingPoint values may be stored and/or transmitted in a data packet. The Delta Modbus
Gateway supports 3 of these formats. The table below lists the 3 formats that Delta
supports and which data type should be selected in the GWT to reference a floating-point
value using this format.
Data Type
Data Format
Float
Floating Point Big Endian
Float (Reversed) Floating Point Little Endian
Float (Swapped) Floating Point Little Endian with byte-swapped
Single Precision (32-bit) floating-point values span two 16-bit registers and can store a
real number value from 3.403 x 10-38 to 3.403 x 1038.
Page 27 of 38
2.
Next calculate the exponent by counting how many decimal places you shifted
to normalize the mantissa. If the decimal was shifted to the left the exponent is
positive and if shifted to the right it is negative. In this case the exponent is +2.
3.
By using the formula above, the scientific notation equivalent of 146.5 is:
Mantissa x Number BaseExponent = 1.465 x 102
Binary scientific notation is done exactly the same way only using binary (base 2)
numbering. For example, the decimal number 146.5 in binary is 10010010.1.
Normalizing the Mantissa gives a value of 1.00100101. The decimal was shifted 7 places
to the left giving an exponent value of +7. Therefore, 146.5 in binary scientific notation
is:
Mantissa x Number BaseExponent = 1.00100101 x 27
IEEE 32-bit Floating-Point notation is similar to binary scientific notation with a few
exceptions:
Page 28 of 38
1.
One bit is used to indicate the sign of the value. (Positive or Negative)
2.
3.
In a base 2 normalized mantissa, the digit on the left of the decimal point
will always be 1. In IEEE format only the fractional portion of the Mantissa
is stored and it is understood there is always an implied 1. in front of it.
Appendices
The following diagram shows how an IEEE floating-point value is stored in a 32-bit
binary number using our example value of 146.5.
146.5 in IEEE 32-Bit Floating-Point Data Format
24
16
8
0
byte 4
byte 3
byte 2
byte 1
0 1 0 0 0 0 1 1 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
31
Sign (1 bit)
Exponent (8 bits)
Sign (bit 31) The sign is stored as a single bit Boolean value (0 = Positive, 1 =
Negative)
Exponent (bits 23-30) The exponent is stored as an 8-bit unsigned integer value.
Mantissa (bits 0-22) The fractional part of the Mantissa stored as a 23-bit binary
fraction.
As stated earlier there are 4 variations on the above data format. The difference between
each of these variations is the order in which each byte of data (as numbered in the table
above) is stuffed into a memory location and/or data packet. The table below gives the
stuffing order for each of the 4 formats:
Data Format
Floating Point Big Endian
Floating Point Big Endian with byte-swapped*
Floating Point Little Endian
Floating Point Little Endian with byte-swapped
Byte Order
4,3,2,1
3,4,1,2
1,2,3,4
2,1,4,3
*Note: Floating Point Big Endian with byte-swapped format is not supported in the Delta Modbus Gateway.
Page 29 of 38
Functions
The Delta Modbus Gateway Controllers support functions 1-6 and 16 of the Modbus
protocol. This section provides detailed information on each of these functions.
Note: Register addresses in the data packets are always zero-based regardless of the
Register Base Count convention being used in documentation.
Example
(Hex)
Slave Address
02
Function
01
Starting Address Hi Byte
00
Starting Address Lo Byte
0A
# of Points Hi Byte
00
# of Points Lo Byte
01
Error Check (CRC)
-
The normal response if the queried coil register was in the on state would be:
Rx Packet (Response)
Field Name
Example
(Hex)
Slave Address
02
Function
01
Data Byte Count
01
Data
01
Error Check (CRC)
In the Data byte the information on the coil state is stored in the least significant bit
(LSB). A value of 1 = On, 0 = Off, and the remaining bits in the data byte are padded
with zeros.
Page 30 of 38
Appendices
Example
(Hex)
Slave Address
19
Function
02
Starting Address Hi Byte
00
Starting Address Lo Byte
C4
# of Points Hi Byte
00
# of Points Lo Byte
01
Error Check (CRC)
-
The normal response if the queried Input Status register was in the off state would be:
Rx Packet (Response)
Field Name
Example
(Hex)
Slave Address
19
Function
02
Data Byte Count
01
Data
00
Error Check (CRC)
In the Data byte the information on the Input Status state is in the least significant bit
(LSB). A value of 1 = On, 0 = Off, and the remaining bits in the data byte are padded
with zeros.
Page 31 of 38
Example
(Hex)
Slave Address
05
Function
03
Starting Address Hi Byte
00
Starting Address Lo Byte
6B
# of Points Hi Byte
00
# of Points Lo Byte
02
Error Check (CRC)
The normal response if holding registers 108 and 109 contained a 32-bit unsigned
integer value of 169,824,461 would be:
Rx Packet (Response)
Field Name
Slave Address
Function
Data Byte Count
Data Byte Hi (Register 40108)
Data Byte Lo (Register 40108)
Data Byte Hi (Register 40109)
Data Byte Lo (Register 40109)
Error Check (CRC)
Page 32 of 38
Example
(Hex)
05
03
04
0A
1F
50
CD
-
Appendices
Example
(Hex)
Slave Address
05
Function
04
Starting Address Hi Byte
00
Starting Address Lo Byte
6B
# of Points Hi Byte
00
# of Points Lo Byte
01
Error Check (CRC)
The normal response if Input register 108 contained a 16-bit unsigned integer value of
2591 would be:
Rx Packet (Response)
Field Name
Example
(Hex)
Slave Address
05
Function
04
Data Byte Count
02
Data Byte Hi (Register 30108)
0A
Data Byte Lo (Register 30108)
1F
Error Check (CRC)
-
Page 33 of 38
Example
(Hex)
Slave Address
11
Function
05
Starting Address Hi Byte
00
Starting Address Lo Byte
AB
Force Data Hi Byte
FF
Force Data Lo Byte
00
Error Check (CRC)
The normal response is an echo of the query, returned after the register contents have
been written to.
Rx Packet (Response)
Field Name
Example
(Hex)
Slave Address
11
Function
05
Starting Address Hi Byte
00
Starting Address Lo Byte
AB
Force Data Hi Byte
FF
Force Data Lo Byte
00
Error Check (CRC)
-
Page 34 of 38
Appendices
Example
(Hex)
Slave Address
11
Function
06
Starting Address Hi Byte
00
Starting Address Lo Byte
01
Force Data Hi Byte
00
Force Data Lo Byte
03
Error Check (CRC)
The normal response is an echo of the query, returned after the register contents have
been written to.
Rx Packet (Response)
Field Name
Example
(Hex)
Slave Address
11
Function
06
Starting Address Hi Byte
00
Starting Address Lo Byte
01
Force Data Hi Byte
00
Force Data Lo Byte
03
Error Check (CRC)
-
Page 35 of 38
Example
(Hex)
Slave Address
11
Function
10
Starting Address Hi Byte
00
Starting Address Lo Byte
01
# of Registers Hi Byte
00
# of Registers Lo Byte
02
Byte Count
04
Data Hi
00
Data Lo
00
Data Hi
00
Data Lo
03
Error Check (CRC)
The normal response returns the slave address, function code, starting address, and
quantity of registers written to.
Rx Packet (Response)
Field Name
Example
(Hex)
Slave Address
11
Function
10
Starting Address Hi Byte
00
Starting Address Lo Byte
01
# of Registers Hi Byte
00
# of Registers Lo Byte
02
Error Check (CRC)
-
Page 36 of 38
Appendices
Exception Responses
For a given entry in a GWT data view, the Exceptions field lists any exception responses
returned for a particular request to a Modbus slave device. Exception codes may be
returned when there is a problem with the request that was received by the Modbus
device. There are 8 pre-defined exception response codes in the Modbus specification:
Code
Name
Description
01
ILLEGAL
FUNCTION
02
ILLEGAL DATA
ADDRESS
03
ILLEGAL DATA
VALUE
04
SLAVE DEVICE
FAILURE
05
ACKNOWLEDGE
06
SLAVE DEVICE
BUSY
07
NEGATIVE
ACKNOWLEDGE
08
MEMORY
PARITY ERROR
In addition to the pre-defined error codes listed above, the Modbus specification
allows custom defined error codes. Refer to documentation for the specific Modbus
slave device for an explanation of any custom error codes returned from a particular
device.
Page 37 of 38
Exception responses are identified by the value of the second byte in the data packet.
In the normal response this byte echoes back the function code of the query packet. In
an exception response this byte also has its most significant bit set. This makes the
byte value exactly 80 hexadecimal greater than in the normal response.
The following example shows an Illegal Data Address exception response to a read
coil status (function 01) query packet sent from a Modbus slave device with an
address of 10.
Rx Packet (Exception Response)
Field Name
Example
(Hex)
Slave Address
0A
Function
81
Exception Code
02
Error Check (CRC)
-
Document Control
Document Title:
Revision
Changes
0.1
1.0
2.0
Page 38 of 38