Honeywell warrants goods of its manufacture as being free of defective materials and faulty
workmanship. Contact your local sales office for warranty information. If warranted goods are
returned to Honeywell during the period of coverage, Honeywell will repair or replace without charge
those items it finds defective. The foregoing is Buyer's sole remedy and is in lieu of all other
warranties, expressed or implied, including those of merchantability and fitness for a
particular purpose. Specifications may change without notice. The information we supply is
believed to be accurate and reliable as of this printing. However, we assume no responsibility for its
use.
While we provide application assistance personally, through our literature and the Honeywell web
site, it is up to the customer to determine the suitability of the product in the application.
Windows is an addressed trademark of Microsoft Inc
The omission of a name from this list is not to be interpreted that the name is not a trademark.
Reference: Modicon Modbus Protocol Reference Guide - PI-MBUS-300 Rev. G
.
ii HC900 Hybrid Controller Communications User Guide Revision 10
12/07
About This Document
Abstract
This document provides information specific to the communications interface for Honeywell’s HC900 Controller.
The protocol supported for connection to the controller’s Ethernet network port is Modbus/TCP (Modbus RTU
protocol in a TCP/IP wrapper). . The document includes a summary of all HC900 data available (primarily floating
point) for Modbus RTU access read and write including methods for access.
Contacts
World Wide Web
The following lists Honeywell’s World Wide Web sites that will be o f interest to our customers.
Honeywell Organization WWW Address (URL)
Corporate
Honeywell Process Solutions http://hpsweb.honeywell.com
IM&C Technical tips
http://www.honeywell.com
http://content.honeywell.com/ipc/faq
Telephone
Contact us by telephone at the numbers listed below.
Country Organization Phone Number
United States and Canada Honeywell
1-800-423-9883 Tech. Support
1-800-525-7439 Service
Revision 10 HC900 Hybrid Controller Communications User Guide iii
12/07
Revision 10 HC900 Hybrid Controller Communications User Guide vii
12/07
Figures
Figure 1-1 Modbus RTU Protocol within a TCP/IP Frame____________________________________ 2
Figure 1-2 Ethernet 10/100Base-T Network Connections_____________________________________ 4
Figure 2-1 IEEE Floating Point Data format_______________________________________________ 7
Figure 3-1 IEEE Floating Point Formats_________________________________________________ 12
viii HC900 Hybrid Controller Communications User Guide Revision 10
12/07
1.1 Overview
Communication interfaces
The HC900 controller provides Modbus communication support on three communication interfaces.
• Network port: Modbus TCP on an Ethernet connection
• Serial Port S1 RS232/RS485 selectable port. (Default RS232.): Modbus RTU
• Serial Port S2 RS232/RS485 selectable port. (Default RS485.): Modbus RTU
View or print addresses
You can print out the Modbus addresses of various parameters of the configuration (signal tags, PID loops,
SP programmer, etc.) using the HC Designer report functions. With HC Designer Ver. 2.1 and later, these
reports may also be exported to .csv files for view/manipulation in a spreadsheet and possible import to
other HMI applications.
Introduction
Overview
1. Introduction
Fixed map or custom map
The type of addressing available: fixed or custom.
Fixed map Custom map
Contains limited types of parameters in limited
quantities (e.g., 32 loops max)
Objects of each type (e.g. loops 1-24, SP
Programmers 1-4, etc.) are grouped and limited to
certain address ranges.
All parameters of a single object are addressed. For
example, a PID loop has over 40 parameters and they
all are mapped.
Editing is limited to
-moving an object to another address within its allowed
range.
-assigning up to 1000 signals and variables to
addresses reserved for that purpose.
Available in all HC900 configuration versions Available in HC900 configuration version 4.0 and higher
More parameters to choose from. Quantities are limited
only by available addresses. (e.g.,can have >32 loops.)
Certain blocks can be assigned to the custom map that
are not available in the fixed map. (See section
Objects (e.g. loop) can be assigned any address or to
multiple addresses and are not limited to certain ranges.
You can select which parameters of an object are
mapped. For example, you can assign only 3 of a loop’s
40+ parameters to the map (such as PV, SP, output),
thereby increasing efficiency.
Edits are virtually unlimited. Uses fixed map settings but
can be edited or rebuilt as needed without the fixed
map’s limitations. Custom partitions can be created for
organizing data however you prefer.
6.18.)
1.2 Modbus/TCP Interface
Introduction
HC900 controllers support the Modbus/TCP (also called Modbus TCP/IP or Modbus Ethernet) protocol for
communications with third party HMI and SCADA software via a direct Ethernet TCP/IP connection.
Revision 10 HC900 Hybrid Controller Communications User Guide 1
12/07
Introduction
Modbus/TCP Interface
The controller’s Ethernet 10/100Base-T Host port is used for the Modbus/TCP connection. Ethernet TCP
allows multiple concurrent connections to hosts for data interchange. The HC900 (C30/C50) supports 5
concurrent host connections using Modbus/TCP protocol messaging via this port; HC900 (C70/C70R)
supports 10.
Interface Preparation
ATTENTION
To access the controller you must have a current Hybrid Control Designer configuration file available. Some
data is referenced relative to number, such as Signal Tags and Variables.
Other principal blocks, such as PID blocks, have offsets for parameter access dependent on the order in
which the blocks were placed on the Function Block Diagram.
It is strongly recommended that you upload the controller configuration using the Hybrid Control
Designer configuration tool to assure that you have a current configuration.
The Hybrid Control Designer tool provides a series of reports for use in Modbus Address identification.
The "Tag Information" report lists the variables and Signal Tags in numeric order along with their Modbus
Addresses.
A "Block Modbus Address" report lists the starting addresses for all principal blocks configured, identifying
the offset.
Modbus/TCP Protocol
Modbus/TCP protocol, developed by Groupe Schneider’s Modicon Division, is a popular, open standard for data
interchange over Ethernet TCP/IP networks using a Modbus RTU command structure.
It is simply an encapsulation of Modicon’s Modbus RTU protocol within a TCP/IP frame as shown below, which
includes header information and the Modbus frame.
Figure 1-1 Modbus RTU Protocol within a TCP/IP Frame
The Open Modbus/TCP Specification is followed with respect to the physical, data link, and network layers. The
message structure within the Modbus frame uses standard Modbus RTU function codes.
The Address part of the Modbus frame is not used (set to 00) since there is no sub-addressing intended or required.
The controller IP address is the identifying address, set independently at the controller.
The error checking is supported by TCP/IP network protocols and not part of the Modbus frame.
The Transaction Identifiers and Protocol Identifiers in the header are normally all 0’s (4 bytes total) while the
Length field identifies the number of bytes in the Modbus frame. The controller will transmit the correct number of
bytes for the remainder of the frame. However, the controller does not check this field for messages received.
The standard IEEE 32-bit floating point and 16-bit integer formats are used.
2 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
Parameter Addressing
Introduction
Modbus/TCP Interface
The definition in
Table 6-1 is the fixed map overview listing starting and ending addresses.
Greater detail for parameter addressing relating to a particular function class (e.g, loops, setpoint programmer,
signal tags) is in referenced sub-sections. Function Codes 1, 2, 3, 4, 5, 6, 8, 16 (10h), and 17 (11h) are supported
Table 4-1 Modbus/TCP and Modbus RTU Function Codes Definitions).
(see
Examples for read or write access to parameters supported by the various function codes are provided in Sections
4.3 through 4.11.
Reference
The Open Modbus/TCP Specification can be obtained at the Modicon website:
See the HC900 Hybrid Control (HC) Designer Users Guide, Doc. # 51-52-25-110 or respective HC Designer Help
Files for setting up the following network parameters:
IP Address, Subnet Mask (optional), Default Gateway IP Address (optional)
1. Be sure the PC, HMI panel, or other Host device has a Network Interface Card (NIC) with an IP
address (fixed or DHCP served) that allows access to controllers on the same or other subnet. Consult
your IT department or network administrator for allocating IP addresses to the controllers as required.
2. You will need to set each controller’s IP address prior to network connection since every HC900
controller is shipped with the default IP address of 192.168.1.254. Placing multiple controllers on the
same network before they have been given unique IP addresses will cause problems.
3. On the PC, use the Utilities Worksheet in the HC Designer software to set up the serial RS-232
connection to the controller at the desired baud rate. This will require a null modem cable.
4. Select the Set Controller’s Network Parameters button. Using the wizard (bottom radio button), select
the PC COM port to be used, then set the controller’s new network parameters including IP address,
Subnet Mask (if other than default, 255.255.255.0), and Default Gateway IP address (if required,
otherwise leave at default 0.0.0.0). See your IT network administrator for proper entries. (Refer to
the on-line help provided with the HC Designer software, Utilities Worksheet, Set Controller’s
Network Parameters, for further details on this step).
Note: This setup will require the controller to be placed temporarily in the Program mode. After the new
network parameters have been downloaded, the controller will conduct a Cold Start in its transition to RUN.
This will cause an initialization if there is a current configuration in the controller.
The fixed IP address of each controller shall be set independently prior to placing on the network. See your IT
systems administrator for allocating IP addresses, subnet masks, or default gateway IP address as necessary
(network address filtering and routing may be necessary if the controller network access will not to be confined
locally within the plant environment).
Revision 10 HC900 Hybrid Controller Communications User Guide 3
12/07
Introduction
Modbus/TCP Interface
Ethernet 10/100Base-T Network Connections
Ethernet 10/100Base-T networks operating at 10/100MB/sec. are supported. A typical network arrangement is as
shown below.
The HC900 predominantly uses an IEEE floating point format for communicating data to software applications
providing Modbus/TCP protocol communications drivers. A floating point value is sent as (2) consecutive 16-bit
registers, each register of which consists of two 8-bit bytes. Some software packages require the registers and bytes
to be sent in a certain order. The controller can be configured to deliver the data in four different byte orders.
The Hybrid Control Designer software tool allows this order to be selected as follows:
1. Using the Utilities Worksheet in the HC Designer software, access the Set Controller Network
Parameters button and make the selection to change the Modbus TCP Double Register Format (middle
radio button).
2. With the Port selected for downloading this order (using a COM port or Network port), select the
appropriate byte order format if the default (FP B) is not appropriate for the application. See
3-1, page
10.
Table
3. Select Next and verify (by the response in the dialog box) that the change has been made in the
controller. This order can be changed in the RUN mode.
The Modbus TCP double register transmission format selection, FP LB “Little Endian Byte-Swapped”, would be
selected for interface to most third party software packages which use this format as standard. The default, FP B
“Big Endian” is used with SpecView32 or Honeywell’s PlantScape/Experion/EBI software and follows the
“Honeywell” default format of other control and recording products. It should be noted that most PC software
packages offer a register (word) swap selection in their driver package anyway, so there should never be an
incompatibility.
4 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
Introduction
Modbus RTU RS232/RS485 Communication Ports
1.3 Modbus RTU RS232/RS485 Communication Ports
This implementation is designed to provide a popular data exchange format connecting the HC900 to both
Honeywell and foreign master devices via the RS232 and RS485 communication ports. The Modbus RTU allows
the instrument to be a citizen on a data link shared with other devices, which subscribe to the Modicon Modbus
Protocol Reference Guide PI-MBUS-300 Rev. G specification.
These instruments DO NOT emulate any MODICON type device. The Modbus RTU specification is respected in
the physical and data link layers. The message structure of the Modbus RTU function codes is employed and
standard IEEE 32-bit floating point and integer formats are used. Data register mapping is unique to the HC900 and
other Honeywell instruments. Section
Modbus RTU Message Format
Coding system 8 bit binary
6 describes the parameter mapping for the HC900.
Table 1-1 Modbus RTU Message Formats
Number of data bits per
character
Parity None, odd, even selectable
Bit transfer rate 1200, 2400, 4800, 9600, 19200, 38400, 57600 Selectable
Duplex Half duplex Transceiver or TX/RX
Error checking CRC (cyclic redundancy check)
Polynomial (CRC-16 10100000000001)
Bit transfer order LSB first
End of message Idle line for 3.5 or more characters (>1.82 msec for 19200).
10, 11, or 12 Bits
start bits - 1
data bits - 8
parity bits – 0 or 1 selectable
stop bits – 1 or 2 selectable
Modbus RTU Link Layer
The link layer includes the following properties/behaviors:
• Slave address recognition,
• Start / End of Frame detection,
• CRC-16 generation / checking,
• Transmit / receive message time-out,
• Buffer overflow detection,
• Framing error detection,
• Idle line detection.
Errors detected by the physical layer in messages received by the slave are ignored and the physical layer
automatically restarts by initiating a new receive on the next idle line detection.
Revision 10 HC900 Hybrid Controller Communications User Guide 5
12/07
Introduction
Modbus RTU RS232/RS485 Communication Ports
General Modbus RTU message format
Query message format
[Slave Address, Function Code, Function code dependent data, CRC 1 6]
Response message format
[Slave Address, Function Code*, Function code dependen t d ata, CRC 16]
* If an error is detected in a valid message the response function code is modified by adding 80 (hex) and the
function code dependent data is replaced by an exception response code as described in
Exception Codes
Between messages, the RS-485 link is in a high impedance state. During this time receiving devices are
more susceptible to noise generated false start of messages. Although noise-generated messages are
rejected due to address, framing, and CRC checking, they can cause the loss of a good message when they
are included in the message stream. In the slave the transmitting device enables its transmitter line diver
and forces an idle line state onto the link for three character time slots prior to transmitting. This forces
termination of any noise generated messages and improves message frame synchronization.
Modbus RTU Data Layer
The data layer includes:
• Diagnostic loopback,
• Function code recognition / rejection,
• Busy / repoll,
• Data error code generation
5. Modbus RTU
.
Errors detected by the data layer are rejected and the slave responds to the polling device with a Modbustype status exception error. A summary of the Modbus status exception codes is listed in Section
5.
Modbus RTU Exception Codes.
6 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
2. IEEE 32-bit Floating Point Register Information
The Modbus interface supports IEEE 32-bit floating point information for several of the function codes.
2.1 IEEE Floating Point Data Format
The formula for calculating the floating point number is:
(exponent -127)
mantissa x 2
(23 bit signed binary with 8 bit biased binary exponent)
The mantissa is defined by a sign bit (31) and a 23-bit binary fraction. This binary fraction is combined
with an “implied” value of 1 to create a mantissa value, which is greater than or equ al to 1.0 and less than
2.0.
The mantissa is positive if the sign bit is zero (reset), and negative if the sign bit is one (set). For example:
Revision 10 HC900 Hybrid Controller Communications User Guide 7
12/07
-1-2-3-4
+++
Exponent
The exponent is defined by an unsigned 8-bit binary value (bits 23 through 30). The value of the exponent
is derived by performing a signed subtraction of 127 (decimal) from the 8-bit exponent value.
Subtract a bias of 127 (decimal) from the exponent to determine its value: 133 – 127 = 6.
Mantissa and Exponent Combination
Combining the mantissa and exponent from the two previous examples:
6
exponent
= 15625.
float number = mantissa x 2
float number = 1.5625 x 2 x 64 = 100.0
Below is a list of sample float values in IEEE format:
DECIMAL HEXADECIMAL
100.0 42C80000
-100.0 C2C80000
0.5 3F000000
-1.75 BFE00000
0.0625 3D800000
1 3F800000
0 00000000
8 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
Reserved Operands
Per the Standard certain exceptional forms of floating point operands are excluded from the numbering
system. These are as follows:
IEEE 32-bit Floating Point Register Information
IEEE Floating Point Data Format
EXCEPTION EXPONENT MANTISSA
+/- Infinity All 1’s All 0’s
Not-a-Number (NAN) All 1’s Other than 0’s
Denormalized Number All 0’s Other than 0’s
Zero All 0’s All 0’s
Revision 10 HC900 Hybrid Controller Communications User Guide 9
12/07
3. Modbus Double Register Format
Data that is 32 bits requires 2 sequential registers (4 bytes) to transfer its data. Data of this type includes IEEE 32bit floating point, 32-bit signed integer and 32-bit unsigned integer. The stuffing order of the bytes into the two
registers differs among Modbus/TCP hosts. To provide compatibility, the double register format for the HC900
controller is configurable.
To set the controller’s double register byte order, go to the “Set Controller Network Parameters ” wizard in the
"Controller Utilities Function" section of the Utilities Tab on the Hybrid Control Designer and configure “Modbus
Double Register Format”. This can be done in the RUN mode.
The selections are:
Table 3-1 Modbus Double Register Format Selections
Selection Description Byte order
(See Figure
2-1)
FP B Floating Point Big Endian Format 4, 3, 2, 1 HC900 default
FP BB Floating Point Big Endian with
byte-swapped
FP L Floating Point Little Endian Format 1, 2, 3, 4
FP LB Floating Point Little Endian with
byte-swapped
See IEEE Formats on page
NOTE: Byte Swapping only applies to Function Codes 3, 4, and 16.
IEEE Floating Point Formats on page 11 and 32-bit integer formats on page 13.
3, 4, 1, 2
2, 1, 4, 3 Modicon and
Wonderware
standard
Notes
10 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
3.1 IEEE Floating Point Formats
FP B - Floating Point Big Endian Format:
Bit 31
Modbus Double Register Format
IEEE Floating Point Formats
Bit 0
E0 M22 M21M20 M19 M18 M17 M16
S E7 E6 E5 E4 E3 E2 E1
M15 M14 M13 M12 M11 M10 M9 M8
M7 M6 M5 M4 M3 M2 M1 M0
HighLowHighLow
REGISTER N
(High)
S=Sign E=Exponent M=Mantissa
REGISTER N+1
(Low)
FP BB - Floating Point Big Endian with Byte Swapped Format:
Bit 31
S E7 E6 E5 E4 E3 E2 E1
Bit 23
E0 M22 M21M20 M19 M18 M17 M16
Bit 16
Bit 24
Bit 15
M15 M14 M13 M12 M11 M10 M9 M8
Bit 7
M7 M6 M5 M4 M3 M2 M1 M0
Bit 0
Bit 8
HighLowHighLow
REGISTER N
(High)
S=Sign E=Exponent M=Mantissa
continued next page
Revision 10 HC900 Hybrid Controller Communications User Guide 11
12/07
REGISTER N+1
(Low)
FP L - Floating Point Little Endian Format:
Bit 8Bit 15
Bit 31
Bit 24
M15 M14 M13 M12 M11 M10 M9 M8
Bit 7
M7 M6 M5 M4 M3 M2 M1 M0
Bit 0
Bit 23
E0 M22 M21M20 M19 M18 M17 M16
HighLowHighLow
REGISTER N
(High)
S=Sign E=Exponent M=Mantissa
REGISTER N+1
(Low)
FP LB - Floating Point Little Endian with Byte Swapped Format:
Bit 7
M7 M6 M5 M4 M3 M2 M1 M0
Bit 8Bit 15
M15 M14 M13 M12 M11 M10 M9 M8
Bit 0
Bit 31
S E7 E6 E5 E4 E3 E2 E1
Bit 23
E0 M22 M21M20 M19 M18 M17 M16
Bit 24
S E7 E6 E5 E4 E3 E2 E1
Bit 16
Bit 16
HighLowHighLow
REGISTER N
(High)
S=Sign E=Exponent M=Mantissa
REGISTER N+1
(Low)
Figure 3-1 IEEE Floating Point Formats
Table 3-2 IEEE Floating Point Number Examples in FP B Format
Value
(decimal)
IEEE FP B
MSB LSB
Register N Register N+1
high low high low
100.0 42C80000h 42h C8h 00h 00h
55.32 425D47AEh 42h 5Dh 47h AEh
2.0 40000000h 40h 00h 00h 00h
1.0 3F800000h 3Fh 80h 00h 00h
-1.0 BF800000h BFh 80h 00h 00h
12 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
Modbus Double Register Format
Unsigned/signed 32-bit Register Formats
3.2 Unsigned/signed 32-bit Register Formats
The formats descriptions below use the value 12345678 Hex as an example. Where the binary representation is:
Revision 10 HC900 Hybrid Controller Communications User Guide 13
12/07
REGISTER N+1
(Low)
FP BB – Big Endian Byte Swapped Format
The value 12345678 Hex will be represented as follows:
Bit 23 Bit 0
Bit 16 Bit 15 Bit 8Bit 7Bit 24 Bit 31
Byte 3
34 Hex
High
REGISTER N
(High)
Byte 4
12 Hex
Low
Byte 1
78 Hex
High
REGISTER N+1
Byte 2
56 Hex
Low
(Low)
14 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
FP L – Little Endian Format
The value 12345678 Hex will be represented as follows:
Modbus Double Register Format
Unsigned/signed 32-bit Register Formats
Bit 7 Bit 16
Byte 1
78 Hex
High
Bit 0 Bit 31 Bit 24 Bit 23 Bit 8 Bit 15
REGISTER N
(High)
Byte 2
56 Hex
Low
Byte 3
34 Hex
High
REGISTER N+1
(Low)
Byte 4
12 Hex
Low
Revision 10 HC900 Hybrid Controller Communications User Guide 15
12/07
FP LB – Little Endian Byte Swap Format
The value 12345678 Hex will be represented as follows:
Bit 15 Bit 24
Byte 2
56 Hex
High
Bit 8 Bit 23 Bit 16 Bit 31 Bit 0 Bit 7
REGISTER N
(High)
Byte 1
78 Hex
Low
Byte 4
12 Hex
High
REGISTER N+1
Byte 3
34 Hex
Low
(Low)
16 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
Modbus/TCP & Modbus RTU Function Codes
Function code definitions
4. Modbus/TCP & Modbus RTU Function Codes
4.1 Function code definitions
The HC900 Modbus protocol uses a subset of the standard Modbus function codes to provide access to processrelated information. These standard function codes provide basic support for IEEE 32-bit floating point numbers,
32-bit unsigned/signed integer and 16-bit integer register representation of instrument’s process data.
Repolling of data is not supported by this instrument.
Table 4-1 Modbus/TCP and Modbus RTU Function Codes Definitions
Function Code Name Usage
01 Read Coil Status Read the state of a digital output
02 Read Input Status Read the state of a digital input
03
04 Read Input Registers Provides Read access to any Analog Input Channel
05 Force Single Coil Write data to force a digital output ON/OFF
06 Preset Single Register Write Data in 16-bit Integer Format (high/low) ONLY.
08 Loopback Test Used for diagnostic testing of the communications port.
16 (10h) Preset Multiple Registers Write Data in 16-bit Format (high/low). Used to write integer
17 (11h) Report Device ID Read instrument ID and connection information, ROM version,
Read Holding Registers
Read data in 16-bit Register Format (high/low). Used to read
integer or floating point process data. Registers are
consecutive and are imaged from the instrument to the host.
positioned in any Rack or Slot.
Values of FF 00 forces digital output ON
Values of 00 00 forces digital output OFF
Values of FF FF releases the force of the digital output
All other values are illegal and will not effect the digital output.
and floating point override data. Registers are consecutive
and are imaged from the host to the instrument.
etc.
Revision 10 HC900 Hybrid Controller Communications User Guide 17
12/07
4.2 Fixed Modbus Map
Table 4-2 and Table 4-3 list the the maximum number of Object Addresses and maximum number of registers
allowed per request. Also shown are differences between firmware versions 2.3 and 2.4.
Note 1: In versions 4.0 and higher these maximums apply to fixed map but not to the custom map.
Note 2: In versions 4.0 and higher function code 03 is not available for analog inputs.
Table 4-2 Maximum Number of Objects (fixed map only)
Note: objects marked with * have multiple parameters and therefore occupy multiple registers. For
example, a PID loop has over 40 parameters that can be accessed.
Object Name
C30 C50/C70/C70R
Analog Inputs 96/12 slots v2.3
192/12 slots v2.4
Max. No. of Objects
640 v2.3
1280 v2.4
3: can only access first 8
slots of rack 1. Not available
in version 4.0 or higher.
4: can access all slots and
racks
Discrete Input 192/12 slots v2.3
384/12 slots v2.4
Discrete Output/Coil 192/12 slots v2.3
384/12 slots v2.4
1280 v2.3
2560 v2.4
1280 v2.3
2560 v2.4
2
1: read
5: force
Loop* 8 32 3
Variable Value 600 600 3
Set Point Programmer Value* 8 8 3
Segments per Set Point
18 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
Modbus/TCP & Modbus RTU Function Codes
Table 4-3 Maximum Number of Registers Allowable per Request
Fixed Modbus Map
Function
Code
1, 2 2040 bits
3, 4 127 Registers
5 1 Coil
6 1 Register
10h 127 Registers
Max. No. of
Registers
63 Floats
63 Floats
Revision 10 HC900 Hybrid Controller Communications User Guide 19
12/07
4.3 Function Code 01 – Read Digital Output Status
Description
Function code 01 (0X references) is used to read a digital output’s ON/OFF status of the HC900 using 16
bit addressing for DO access and data is returned in a binary format mapped into bytes.
The Modbus Comm Digital I/O Channel-to-address mapping is shown starting on page
26.
Broadcast is not supported.
Query
The query message specifies the starting Digital Output (DO) and the quantity of DOs to read. The DO
address in the message is based on the rack slot and channel number of the digital output being read.
Example Query: Read DO channels 1 to 16, located in Rack #1, Slot #1; from the controller with slave
address 1.
Query message format for function code 01
Slave
Address
(00 for TCP)
TCP Example 00 01 00 00 00 10
RTU Example 01 01 00 00 00 10 CRC CRC
Function
Code
Starting
Address
High
Starting
Address
Low
Number
DO
High
Number
DO
Low
CRC
(RTU)
CRC
(RTU)
Response
The DO status in the response message is packed as one DO per bit of the data field. Status is indicated as:
1 = ON; 0 = OFF. The LSB of the first data byte contains the DO addressed in the query. The other DOs
follow toward the high order end of this byte, and from low order to high order in subsequent bytes.
If the returned DO quantity is not a multiple of eight, the remaining bits in the final data byte will be
padded with zeros (toward the high order end of the byte). The byte count field specifies the quantity of
data bytes returned.
Example Response: DO channels 2 and 6 located in Rack #1, Slot #1 are on; all others are off.
Response message format for function code 01
Slave
Address
(00 for TCP)
TCP Example 00 01 02 22 00
RTU Example 01 01 02 22 00 CRC CRC
Function
Code
Byte
Count
Data Data CRC
(RTU)
CRC
(RTU)
In the response the status of DOs 1 - 8 is shown as the byte value 22 hex, or 0010 0010 binary. DO 8 is the
MSB of this byte, and DO 1 is the LSB. Left to right, the status of DO 8 through 1 is: OFF-OFF-ON-OFFOFF-OFF-ON-OFF. The status of DOs 9 - 16 are shown a 00hex, or 0000 0000 with the same bit
ordering.
20 HC900 Hybrid Controller Communications User Guide Revision 10
12/07
Digital I/O Channel to Address Mapping
If you have any 32-channel DI/DO modules or if you have firmware version 2.4 or higher you must use the
newer maps in
Table 4-4 and Table 4-5. However, use the older maps in Table 4-6 and Table 4-7 if:
• Your controller is firmware version 2.3 or earlier or
• You have already mapped out 16-channel DI/DO, have no 32-channel DI/DO modules, and don’t
want to change to the newer map.
Note: Up to 16 slots are accommodated in the protocol even though the largest rack available supports 12
slots.
Each DI/DO consumes 1 Modbus bit address.
Decimal addressing is typically non-zero based for DI/DO access (1-based), applicable to coil or register
address.
Table 4-4 DI/DO Address Map (v2.4 and higher, up to 32-channel)
Rack Channels Coil number/register number Modbus Hex
The coil (register) number for a DI/DO is based on the DI/DO’s position in the card cage. It is determined
from the formula:
Coil (register) Number = [(Rack-1)*512] + [(Slot-1)*32] + channel in module + 2000
Example: To monitor a coil (register) located in the 2nd channel of slot 10 of rack 3, the Modbus coil
(register) number is:
[(3-1)*512] + [(10-1)*32] + 2 + 2000 = 3314
Some third party software packages will require the 1-based coil/register number to be used for the address
while others will require the 0-based hex address.
Revision 10 HC900 Hybrid Controller Communications User Guide 21
12/07
Table 4-5 Rack #1 DI/DO Address map (version 2.4 and higher, up to 32-channel)