Modbus Registers
Eaton Power Xpert Gateway PXGX UPS Card User’s Guide 164202123—Rev 1
58
Modbus Register Addressing
This section describes Modbus function codes, data formats, and data addressing.
Modbus Function Codes
The UPS registers are read using Modbus Function Codes (FC). For most UPS registers, FC 04 is used. For
alarms, FC 02 is used. The UPS supports the following hex function codes:
Data Formats
Modbus programs usually provide an option for viewing various data types. Refer to your Modbus program
documentation for detailed information on viewing data options.
A register is 16 bits (two bytes). The UPS supports the following data types:
l
STRING
– A string of ASCII characters (two per register). Consult the Size parameter to find the string's
length for a given entry (it is a multiple of two so that entries are register-aligned).
l
FLOAT
– A 32-bit IEEE754 floating point number. FLOATs are always two registers.
l
UINT
– An unsigned integer. Consult the Size parameter to find the integer's size (in bytes) for a given entry
(it is a multiple of two so that entries are register-aligned).
l
TIME
– The TIME type (ym dh ms) consists of six bytes specifying the year, month, day, hour, minutes, and
seconds. The bytes are stored in hexadecimal format. If your Modbus application displays the individual
bytes in a register, view the bytes using the decimal option. Otherwise, the bytes are best viewed by
displaying the two-byte register in a binary format and translating each byte to decimal.
For example, if today is May 17, 2010 and the time is 10:45 and 20 seconds, viewing each byte in decimal
would yield the following data, which is viewable as the year (10), month (05), day (17), hour (10),
minutes (45), and seconds (20):
See “Time or Date (FC 04)” on page 61 for more information.
l
BOOL
– A binary (Boolean) value of 0 or 1. BOOL is usually assigned to discrete input alarms.
Data Addressing
If a data type spans multiple registers (such as a FLOAT), lower addressed registers map to higher-order parts
of the value. Within each register, data is in most significant bit (MSB) first format.
Note:
A Modbus register contains two bytes. Therefore, the number of registers containing the information
can be obtained by dividing the bytes by two. For example, the vendor name in Table 10 on page 60
can be obtained by reading 32 Modbus registers starting at register 1032.
Note:
If a register is not supported in a particular device, an exception response is returned.
Table 8. Function Codes
FC
Hex
Description
Use
01
0x01
Read Coil Status
Supported for compatibility purposes;
returns the same data as FC 02
02
0x02
Read Discrete Inputs
Single input data, such as alarms and discrete contacts
03
0x03
Read Holding Registers
Supported for compatibility purposes;
returns the same data as FC 04
04
0x04
Read Input Registers
Analog data (most string and numeric data types), such as voltage
05
0x05
Write Single Coil
For future use
06
0x06
Write Single Register
For future use
07
0x0F
Write Multiple Coils
For future use
08
0x10
Write Multiple Registers
For future use
10 05
17 10
45 20