What the User Needs to Know
MODBUS RTU (Remote Terminal Unit) is used for communication with any controller that supports the interfaces specified in this document. It is assumed that the user has a sufficient understanding of the capabilities and limitations of the controller.
Danfoss Frequency Converters with Modbus RTU
All Danfoss frequency converters come with a built-in RS 485 interface for the Modbus protocol by default. The maximum data transmission speed may vary depending on the model and software version. To ensure a reliable connection, the speed should not exceed 38400 baud, while the default speed is set at 9600 baud. To further configure communication via the Modbus RTU protocol on the VLT frequency converter, the following parameters need to be set:
Parameter Code | Parameter Name | Parameter Value |
8-30 | Protocol | Modbus RTU |
8-31 | Address | 1 – 247 |
8-32 | Data Speed | Transmission 2400 - 115200 |
8-33 | Parity Control Bits / Stop Bits | Odd parity check, 1 stop bit (by default) |
Configuring VLT frequency converters that do not have a USB port for communication via Modbus needs to be done from the operator panel, as the RS 485 port will be occupied by Modbus, and the converter will be unavailable for communication with a PC using the FC protocol (parameter 8-30).
Controllers are set up for communication over the Modbus network in RTU (Remote Terminal Unit) mode. Each 8-bit byte contains two 4-bit hexadecimal characters. Below is the format for each byte:
Bits in Byte | 1 start bit, 8 data bits (least significant bit is transmitted first), 1 bit for odd/even parity, 1 stop bit (when using parity check), 2 stop bits (if parity check is not used) |
Error Detection Field | Cyclic Redundancy Check (CRC) |
Function Codes Supported by Modbus RTU
The Modbus RTU protocol supports the use of the following function codes in the function field of the message:
Function | Function Code |
Read from Coil | 1 hex |
Read from Holding Registers | 3 hex |
Write Single Coil | 5 hex |
Write Single Register | 6 hex |
Write Multiple Coils | 15 hex |
Write Multiple Registers | 16 hex |
Read Exception Status | 14 hex |
Error Messages
A complete description of the exception response structure is provided in the section "Modbus RTU Message Frame Structure".
Exception Code | Description of Exception Code |
00 | Parameter number not in use |
01 | No access to the parameter for writing |
02 | Data value exceeds parameter limits |
03 | Lower index in use does not exist |
04 | Parameter type is not an array |
05 | Data type does not match the call |
06 | Read-only |
07 | Modification not allowed |
11 | No access for writing |
17 | Data change not possible in the called parameter in the current mode |
18 | Other error |
64 | Incorrect data address |
65 | Incorrect message length |
66 | Incorrect data length or their value |
67 | Incorrect function code |
130 | No bus access to the called parameter |
131 | Data change not possible because factory setting is selected |
Parameter Operations
The parameter number (PNU) is transferred from the register address contained in the Modbus message being read or written. The parameter number is transmitted in the Modbus message as a decimal number equal to 10 multiplied by the parameter number.
Register numbering starts from 0, while parameters start from 1. In most controllers, automatic subtraction of 1 is not provided, thus it should be subtracted from the address when calculating it. For example, parameter 3-100 will have an address in ModBus of 3100*10-1 = 3099 = C1B hex. Since the parameter value can only be transmitted as an integer, a conversion coefficient should be used to transmit the fractional part after the decimal point. Refer to the programming guide for the corresponding converter.
Parameter Values
Standard Data Types
Standard data types include int16, int32, uint8, uint16, and uint32.
Parameter writing is performed using function 6HEX "Set Value of a Single Register" for one register (16 bits) and function 10HEX "Set Value of Multiple Registers" for two registers (32 bits). The range of readable sizes: from 1 register (16 bits) to 10 registers (20 characters).
Non-Standard Data Types
Non-standard data types are text strings; they are stored as registers 4x (40001 – 4FFFF). Parameters are read using function 03HEX "Read Holding Registers" and written using function 10HEX "Set Value of Multiple Registers". The range of readable sizes: from 1 register (2 characters) to 10 registers (20 characters).
Example of Setting a Single Register (06HEX)
This function allows setting a value in a single holding register.
The request message defines the task of the register being set. Register addresses start from zero, thus the address of register 1 will be 0. Parameter numbers need to be multiplied by 10. Parameters 1-24 will have addresses 1-24*10-1 = 1239 = 4DC HEX.
Field Name | Example (HEX) |
Slave Device Address | 01 |
Function | 06 |
Register Address HI | 04 |
Register Address LO | DC |
Data to be Set HI | 00 |
Data to be Set LO | 64 |
Error Check (CRC) | – |
The set values are converted to hexadecimal considering the conversion coefficient (as noted in the programming manuals). Thus, a current of 1A = 1.00*100= 64 HEX.