Modbus RegistersEaton Power Xpert Gateway PXGX UPS Card User’s Guide 164202123—Rev 1 58Modbus Register AddressingThis section describes Modbus function codes, data formats, and data addressing.Modbus Function CodesThe UPS registers are read using Modbus Function Codes (FC). For most UPS registers, FC 04 is used. Foralarms, FC 02 is used. The UPS supports the following hex function codes:Data FormatsModbus programs usually provide an option for viewing various data types. Refer to your Modbus programdocumentation 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'slength 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, andseconds. The bytes are stored in hexadecimal format. If your Modbus application displays the individualbytes in a register, view the bytes using the decimal option. Otherwise, the bytes are best viewed bydisplaying 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 decimalwould 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 AddressingIf a data type spans multiple registers (such as a FLOAT), lower addressed registers map to higher-order partsof 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 informationcan be obtained by dividing the bytes by two. For example, the vendor name in Table 10 on page 60can 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 CodesFC Hex Description Use01 0x01 Read Coil Status Supported for compatibility purposes;returns the same data as FC 0202 0x02 Read Discrete Inputs Single input data, such as alarms and discrete contacts03 0x03 Read Holding Registers Supported for compatibility purposes;returns the same data as FC 0404 0x04 Read Input Registers Analog data (most string and numeric data types), such as voltage05 0x05 Write Single Coil For future use06 0x06 Write Single Register For future use07 0x0F Write Multiple Coils For future use08 0x10 Write Multiple Registers For future use10 05 17 10 45 20