User manual

68
D. MODBUS Interface
D.1. General information
For remote control and monitoring of devices the MODBUS interface in each CS121 M can
read out measurement values, events, status and other information in a master-slave protocol.
Note: Please note that not all UPS models support all or specific measurement
values (e.g. battery low).
D.2. Available Modbus Function Codes
Implemented MODBUS functions in the CS121 M units:
01H Read Coils
02H Read Discrete Inputs
03H Read Holding Registers
04H Read Input Registers
05H Write Single Coil
Which functions are supported depends on the connected UPS. For standard UPS only
functions 03H and 04H are available. In this case the CS121 M makes no difference between
function 03H and 04H. The baud rate is adjustable up to 115200 Baud.
Note: Please note that the MODBUS adapter client allows a timeout of 40ms at
9600 baud for one value.
D.3. Exception Codes
Except for broadcast messages, when a master device sends a query to a slave device it
expects a normal response. One of four possible events can occur from the master's query:
If the slave device receives the query without a communication error, and can handle the query
normally, it returns a normal response.
If the slave does not receive the query due to a communication error, no response is returned.
The master program will eventually process a timeout condition for the query.
If the slave receives the query, but detects a communication error parity, LRC, or CRC, no
response is returned. The master program will eventually process a timeout condition for the
query.
If the slave receives the query without a communication error, but cannot handle it (for
example, if the request is to read a non existent register the slave will return an exception
response informing the master of the nature of the error.
Available Exception codes:
Code Meaning
01H Illegal Function:
The command received in the query is not defined.
02H Illegal Address:
The address received in the query is not defined for the slave.
04H Slave Device Failure:
Internal slave device error.
D.4. MODBUS Modes in the CS121 M (ASCII and RTU)
MODBUS Command
The following tables contain the general command descriptions and examples with ASCII and
RTU framing.
Read Words (Functions 03h and 04h)