EKC Modbus Danfoss
EKC Modbus Danfoss
Features • Simplicity
• Standard Ethernet
• Open protocol
• Availability on many devices
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Definitions and abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Wiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
RS-485 specific . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Repeater . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Cable connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Conductors in a daisy chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Ground connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Introduction Making a network means to connect devices together with a communication bus. But to make
reliable and high performance networks strict rules must be followed.
Wiring
Wiring types Two types of wires can be used based on required ruggedness:
1. Twisted pair with ground: short leads, no power lines in proximity.
2. Twisted pair + ground and shield: long leads, disturbed environment.
Recommendations When choosing a transmission line for RS-485, it is necessary to examine the required distance of the
(Source Modbus.org) cable and the data rate of the system.
An RS485-Modbus must use a balanced pair (for D+-D-) and a third wire (for the Common/Gnd).
For RS485-Modbus, Wire Gauge must be chosen sufficiently wide to permit the maximum length
(1000 m ). AWG 22 is always sufficient for the Modbus Data.
Category 5 cables may operate for RS485-Modbus, to a maximum length of 600m.
For the balanced pairs used in an RS485-system, a Characteristic Impedance with a value higher than
100 Ohms may be preferred, especially for 19200 and higher baud rates.
Use one twisted pair of conductors for connecting the differential signals and use another conductor
(for example a second twisted pair) for connecting the ground.
Note! Connection of a twisted cable in a 2-wire Modbus system may cause damages.
Wire length
Length (m) Max. baudrate Min. Wire size Suggested types
1000 125 K AWG22 Belden 3106A / 3107A
RS-485: Controllers The maximum number of controllers that can be connected to a Modbus line is 120.
One repearter must be added for every 32 controllers. If the data communication cable runs through
an electrically noisy environment which impairs the data signal, one or more repeaters must be
added to stabilize the signal.
Modbus
Master Slaves
84B3210.10
Danfoss
max. 1000 m
Modbus Repeater
Slaves Slaves
84B3210.10
Danfoss
Master
Topology
Standard topology The controller should be connected according to the bus topology. That means that the communica-
tion cable is wired from one controller to the next without branches.
Three conductors
T T
001 002 n
T T
001 002 n
84B3202.10
Danfoss
Legend
Shield
Communication cable, 120 Ω impedance
T 120 Ω termination
84B3204.10
Danfoss
Field BUS
84B3203.10
Danfoss
Stub
- 0.0.0. - 0.0.0.
Min 10-15 cm
84B3207.10
Danfoss
When controllers are installed in a cabinet,
internal cable ducting must also comply with
the relevant requirements. Use this cable
ducting when one or more controllers are
installed in a cabinet. The short connections
between controllers must also be of the cor-
rect cable types.
84B3209.10
Danfoss
Note! On running/bundling the communica-
tion wires very close to high power wires or
other sources of electrical noise (frequency
converters etc.) could cause electromagnetic
interference. Therefore, try to separate the
wires from such sources if possible. - 0.0.0. - 0.0.0. - 0.0.0.
Cable connection and Connect the RS-485 cable to the dedicated terminals of the EKD controller:
termination Modbus • Negative (B-) polarity wire to terminal 9
• Positive (A+) polarity wire to terminal 10
• Cable screen to terminal 11.
EIM
Modbus to master
controller
TxD- TxD+
D
PWR
COM
PO
S2
S4
ADR
EEV
84B3208.10
80G168.10
Danfoss
Danfoss
Termination There must be always two terminations on the network, one at each bus end.
The termination can be installed by connecting a 120 Ohm ± 10 % resistor between D+ and D-
for RS-485.
Here is shown a picture of how a Modbus network is typically terminated. The resistors are in this
picture called LT (Line Termination) and are typically 120 Ohm.
The pull up and pull down are usually built into the master on the Modbus. They are not built in
Danfoss controllers i.e EIM 336, EKD 316.
Master 5V
D
R
Pull up
D+
LT Ballanced Pair LT
D–
Pull down
Common
R R
D D
Figure. Two wire bus trophology
80G169.10
Slave 1 Slave 2
Danfoss
Modbus
84B3212.10
Danfoss
D+ D- D+ D- D+ D-
Shield (drain) should only be connected in one end, not both ends.
In case of EIM, this is how it is done. The communication line in PWR and COM are internally connected.
RS485 + RS485 +
R = 120 Ohm
Master controller Min. 0.25 Watt
PWR
COM
PWR
COM
80G165.10
RS485 -
Danfoss
RS485 -
EIM slave 1 EIM slave 2
Note! If two EIMs are connected remember to remove the addressing jumper on one of the EIMs.
Ground connections There must be a clean ground connection between all devices connected in the network.
In unisolated controller like EKD and EIM, if grounding is required , it should strick followed the
guideline as explained on section 3.1
Note! Be careful when connecting the bus to devises that have non isolated communication interfaces. If
the units are tied to different ground potentials, this may lead to communication problems or even to
damage to the units!
Introduction This Chapter explains how to configure the communication between a EKE(/EKD/EIM) and a system
controller, using the Modbus RTU (Remote Terminal Unit) protocol. For detailed information about
Modbus communication, refer to Modbus Application Protocol Specifications V1.1b from
www.modbus.org
RS-485 Communication The Electronics Industry Association (EIA) established the RS-485 standard as a guide for developing a
multi-drop, bi-directional communication network.
RS-485 systems can be implemented using two-wires or four-wires modes. Danfoss uses the two-
wires system with shield. With the two-wires system, communication is half-duplex (cannot transmit
and receive at the same time).
The Modbus line uses one twisted–pair line – two wires twisted around themselves. This is known as
balanced data transmission. The signal on one wire is ideally the exact opposite of the signal on the
second wire. In other words, if one wire is transmitting a high, the other wire will be transmitting the
low, and vice versa. Since RS-485 is a multipoint communication system, all devices are connected to
the single twisted-pair cable.
The RS-485 system uses master/slave architecture, where each slave device (EKE/EKD/EIM) ) has its
unique address and responds only to requests packets addressed to this device. The requests packets
are generated by the master (system controller), which periodically polls all connected slave devices.
Data travels over the single line in both directions.
A basic RS-485 system requires an I/O driver with differential outputs and an I/O receiver with dif-
ferential inputs. Since the signal is transferred via a twisted pair of wires, if noise or interference is
introduced into the line, the voltage difference (between twisted pair wires) of this interference
is almost zero. Because the input to the receiver is differential, this interference is eliminated. Differ-
ential inputs also ignore different earth potentials of the transmitter and the receiver.
Modbus RTU message The controllers are set up to communicate on the Modbus network using RTU (Remote Terminal Unit)
mode, with each byte in a message containing consisting of 11 bit. The format for each byte is shown
below.
Cooling system 8-bit binary, hexadecimal 0–9, A–F. Two hexadecimal characters contained
in each 8-bit field of the message
Bits Per Byte 1 start bit
8 data bits, least significant bit send first
1 bit for even/odd parity; no bit for no parity
1 stop bit if parity is used; 2 bit if no parity
Error check field Cylindric Redundance Check (CRC)
Danfoss controller follows the standard modbus communication with the following defaults :19200
Baudrate, Even parity and one stop bit.
In EIM/EKD, communication frequency (baudrate) can be one of the following: 9600 baud, 19200
baud and 38400 baud.
The only available fixed communication setting in EKD is 8 data bit, EVEN parity and 1 stop bit.
The default unit address is 240 which, can be changed using parameter “03 unit address”. Whereas a
wide range of selection bits are available in EIM modbus , check the product manual for detail.
Example
How to access parameters The PNU (Parameter Number) is translated from the register address contained in the Modbus read
or write message. For detail check the section ‘Example’
When addressing holding registers on Modbus, the range of valid addresses is 0-65535 (0x0000 to
0xFFFF). In the documentation they are however often described in two different ways.
The first is using register numbers instead of addresses. By this convention the range of valid register
numbers is 1-65536, and the register address 0 is refered to as register number 1. Danfoss follows this
convention so when reading the PNU (Parameter Number) 117, the actual request asks for data from
address 116. So address = PNU – 1.
The second convention defines seperate ranges for different types of registers (coils, discrete inputs,
input register and holding registers). The number of available registers were originally limited to
10000 for each type, and in order to easily distinguish between the register types, in manuals etc.,
each type was assigned a part of the numbering range. In this way holding registers were numbered
from 40001 to 50000. The address range is however the same as before so the first holding register
with register number 40001 still is addressed on Modbus as address 0. So address = register number –
40001. This convention was introduced by the company Modicon and is therefore often referred to as
the Modicon convention.
Example The following examples illustrate various Modbus RTU commands in EKD
Note! 1. Requests are shown in blue and the hexadecimal representation of the data on the Modbus .
2. Responses are shown in green. The text in green is an interpretation of the response.
Action Description
Result Verify that the EKD respond the Modbus master with an accept message.
Action Description
Example The following examples illustrate various Modbus RTU commands in EKD
Note! 1. Requests are shown in blue and the hexadecimal representation of the data on the Modbus .
2. Responses are shown in green. The text in green is an interpretation of the response.
Action Description
Action Description
Action Description
Example The following examples illustrate various Modbus RTU commands in EKD
Note! 1. Requests are shown in blue and the hexadecimal representation of the data on the Modbus .
2. Responses are shown in green. The text in green is an interpretation of the response.
Action Description
Setup Examples explaining some illegal addressing and request with 0x03 (Read function) and 0x06 (Write).
Conclusion Read 2 register starting from PNU 2008 from slave 240
[F0][03][07][D7][00][02][60][66]
[F0][83][02][91][02] - slave responds illegal address because 2009 is not defined
Read o03 unit address (PNU 2008) from slave 240 with wrong CRC
[F0][03][07][D7][00][01][20][68]
no response
Write 1 to r12 main switch (PNU 117) on slave 240 with wrong CRC
[F0][06][00][74][00][01][1D][31]
no response
Example The following examples illustrate various Modbus RTU commands in EIM
Note! 1. Requests are shown in blue and the hexadecimal representation of the data on the Modbus .
2. Responses are shown in green. The text in green is an interpretation of the response.
Action Description
Action Description
Action Description
Example The following examples illustrate various Modbus RTU commands in EIM
Note! 1. Requests are shown in blue and the hexadecimal representation of the data on the Modbus .
2. Responses are shown in green. The text in green is an interpretation of the response.
Action Description
Action Description
Appendix.1
For detail description on the above parameters, please refer to the product user guide
Appendix 2
For detail description on the above parameters, please refer to the product user guide/installation guide.
Modbus exception code For a full explanation of the structure of an exception code response, please refer to the Modbus
specification.”
2 Illegal data adress The data address received in the query is not an allowable address for the server (or slave).
More specifically, the combination of reference number and transfer length is invalid. For a
controller with 100 registers, a request with offset 96 and length 4 would succeed. a request
with offset 96 and length 5 will will generate exeption 02.
3 Illegal data value A value contained in the query data field is not an allowable value for the server (or slave).
This indicates a fault in the structure of the remainder of a complex request, such as that
the implied length is incorrect. It specifically does NOT mean that a data item submitted for
storage in the register has a value outside the expectation of the application program since
the Modbus protocol is unaware of the significance of any particular value of any particular
register.
4 Slave device failure An unrecoverable error occurred while the server (or slave) was attemptingto perform the
requested action.
Appendix 4. Following are some of the free modbus tool available on the Internet.
Please note that Danfoss doesn't provide any support on any third party modbus
communication tools.
Some non commercial free programs are:
ModbusMat - http://www.ataytugal.com/ModbusMat.htm
Modbus Request Pro:
http://forums.mrplc.com/index.php?app=downloads&showfile=465
Please note that there may be restrictions on the use of above stated modbus tools for commercial
applications