0% found this document useful (0 votes)
512 views17 pages

Modbus RTU VLT Micro Drive

The document discusses RS485 network installation and setup for VLT Micro Drives. Key points include: - RS485 uses twisted pair cable in a multidrop topology with a maximum of 32 nodes and repeaters to divide segments. Each node requires a unique address. - The cable must be properly terminated at each end and screened to reduce noise. Connect the cable screen to earth at each node. - When connecting motor cables, use screened cable and maintain sufficient distance from other cables to reduce electromagnetic interference.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
512 views17 pages

Modbus RTU VLT Micro Drive

The document discusses RS485 network installation and setup for VLT Micro Drives. Key points include: - RS485 uses twisted pair cable in a multidrop topology with a maximum of 32 nodes and repeaters to divide segments. Each node requires a unique address. - The cable must be properly terminated at each end and screened to reduce noise. Connect the cable screen to earth at each node. - When connecting motor cables, use screened cable and maintain sufficient distance from other cables to reduce electromagnetic interference.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 17

RS485 Installation and Set-...

VLT Micro Drive Design Guide

8 RS485 Installation and Set-up


RS485 is a two-wire bus interface compatible with multidrop network topology, i.e. nodes can be connected as a bus, or via drop cables from a common trunk line. A total of 32 nodes can be connected to one network segment. Repeaters divide network segments. Please note that each repeater functions as a node within the segment in which it is installed. Each node connected within a given network must have a unique node address, across all segments. Terminate each segment at both ends, using either the termination switch (S801) of the frequency converters or a biased termination resistor network. Always use screened twisted pair (STP) cable for bus cabling, and always follow good common installation practice. Low-impedance earth connection of the screen at every node is important, including at high frequencies. Thus, connect a large surface of the screen to earth, for example with a cable clamp or a conductive cable gland. It may be necessary to apply potential-equalizing cables to maintain the same earth potential throughout the network - particularly in installations with long cables. To prevent impedance mismatch, always use the same type of cable throughout the entire network. When connecting a motor to the frequency converter, always use screened motor cable.
Cable: Screened twisted pair (STP) Impedance: 120 Cable length: Max. 1200 m (including drop lines) Max. 500 m station-to-station Illustration 8.1 Terminator Switch Factory Setting

8.1.2 Frequency Converter Hardware Setup


Use the terminator dip switch on the main control board of the frequency converter to terminate the RS485 bus.
130BB966.10

8 8

8.1.1 Network Connection


Connect the frequency converter to the RS485 network as follows (see also diagram): 1. Connect signal wires to terminal 68 (P+) and terminal 69 (N-) on the main control board of the frequency converter. 2. Connect the cable screen to the cable clamps. The factory setting for the dip switch is OFF.

NOTE
Screened, twisted-pair cables are recommended in order to reduce noise between conductors.
61 68 69 COMM. GND P N
130BB795.10

MG02K102 - VLTp is a registered Danfoss trademark

69

RS485 Installation and Set-...

VLT Micro Drive Design Guide

8.1.3 EMC Precautions


The following EMC precautions are recommended in order to achieve interference-free operation of the RS485 network. Relevant national and local regulations, for example regarding protective earth connection, must be observed. The RS485 communication cable must be kept away from motor and brake resistor cables to avoid coupling of high frequency noise from one cable to another. Normally a distance of 200mm (8 inches) is sufficient, but keeping the greatest possible distance between the cables is generally recommended, especially where cables run in parallel over long distances. When crossing is unavoidable, the RS485 cable must cross motor and brake resistor cables at an angle of 90 degrees.
130BC010.10

8.1.4 Frequency Converter Parameter Settings for Modbus Communication


The following parameters apply to the RS485 interface (FCport):
Parameter 8-30 Protocol 8-31 Address Function Select the application protocol to run on the RS485 interface Set the node address. Note: The address range depends on the protocol selected in 8-30 Protocol 8-32 Baud Rate Set the baud rate. Note: The default baud rate depends on the protocol selected in 8-30 Protocol 8-33 Parity / Stop Bits 8-35 Minimum Response Delay Set the parity and number of stop bits. Note: The default selection depends on the protocol selected in 8-30 Protocol Specify a minimum delay time between receiving a request and transmitting a response. This function is for overcoming modem turnaround delays. Specify a maximum delay time between transmitting a request and receiving a response.

8 8
Fieldbus cable

8-36 Maximum Response Delay

Min.200mm

90 crossing

Brake resistor

70

MG02K102 - VLTp is a registered Danfoss trademark

RS485 Installation and Set-...

VLT Micro Drive Design Guide

8.2 FC Protocol Overview


The FC protocol, also referred to as FC bus or Standard bus, is the Danfoss standard fieldbus. It defines an access technique according to the master-slave principle for communications via a serial bus. One master and a maximum of 126 slaves can be connected to the bus. The master selects the individual slaves via an address character in the telegram. A slave itself can never transmit without first being requested to do so, and direct message transfer between the individual slaves is not possible. Communications occur in the halfduplex mode. The master function cannot be transferred to another node (single-master system). The physical layer is RS485, thus utilizing the RS485 port built into the frequency converter. The FC protocol supports different telegram formats:

8.3 Network Configuration 8.3.1 Frequency Converter Set-up


Set the following parameters to enable the FC protocol for the frequency converter.
Parameter 8-30 Protocol 8-31 Address 8-32 Baud Rate 8-33 Parity / Stop Bits Setting FC 1 - 126 2400 - 115200 Even parity, 1 stop bit (default)

8.4 FC Protocol Message Framing Structure 8.4.1 Content of a Character (byte)


Each character transferred begins with a start bit. Then 8 data bits are transferred, corresponding to a byte. Each character is secured via a parity bit. This bit is set at "1" when it reaches parity. Parity is when there is an equal number of 1s in the 8 data bits and the parity bit in total. A stop bit completes a character, thus consisting of 11 bits in all.
195NA036.10

A short format of 8 bytes for process data. A long format of 16 bytes that also includes a parameter channel. A format used for texts.

8 8

8.2.1 FC with Modbus RTU


The FC protocol provides access to the Control Word and Bus Reference of the frequency converter. The Control Word allows the Modbus master to control several important functions of the frequency converter.

Start bit

Even Stop Parity bit

8.4.2 Telegram Structure


Each telegram has the following structure: 1. 2. 3. Start character (STX)=02 Hex A byte denoting the telegram length (LGE) A byte denoting the frequency converter address (ADR)

Start Stop of the frequency converter in various ways:

Coast stop Quick stop DC Brake stop Normal (ramp) stop

Reset after a fault trip Run at various preset speeds Run in reverse Change of the active set-up Control of the 2 relays built into the frequency converter

A number of data bytes (variable, depending on the type of telegram) follows. A data control byte (BCC) completes the telegram.
195NA099.10

STX

LGE

ADR

DATA

BCC

The Bus Reference is commonly used for speed control. It is also possible to access the parameters, read their values, and where possible, write values to them. This permits a range of control options, including controlling the setpoint of the frequency converter when its internal PI controller is used.

MG02K102 - VLTp is a registered Danfoss trademark

71

RS485 Installation and Set-...

VLT Micro Drive Design Guide

8.4.3 Telegram Length (LGE)


The telegram length is the number of data bytes plus the address byte ADR and the data control byte BCC. The length of telegrams with 4 data bytes is The length of telegrams with 12 data bytes is The length of telegrams containing texts is
1)

LGE = 4 + 1 + 1 = 6 bytes LGE = 12 + 1 + 1 = 14 bytes 101)+n bytes

The 10 represents the fixed characters, while the n is variable (depending on the length of the text).

8.4.4 Frequency Converter Address (ADR)


Address format 1-126 Bit 7 = 1 (address format 1-126 active) Bit 0-6 = frequency converter address 1-126 Bit 0-6 = 0 Broadcast The slave returns the address byte unchanged to the master in the response telegram.

8.4.5 Data Control Byte (BCC)

8 8

The checksum is calculated as an XOR-function. Before the first byte in the telegram is received, the Calculated Checksum is 0.

8.4.6 The Data Field


The structure of data blocks depends on the type of telegram. There are three telegram types, and the type applies for both control telegrams (master=>slave) and response telegrams (slave=>master). The 3 types of telegram are: Process block (PCD) The PCD is made up of a data block of 4 bytes (2 words) and contains: Control word and reference value (from master to slave) Status word and present output frequency (from slave to master)
130BA269.10
130BA270.10 130BA271.10

STX

LGE

ADR

PCD1

PCD2

BCC

Parameter block The parameter block is used to transfer parameters between master and slave. The data block is made up of 12 bytes (6 words) and also contains the process block.
STX LGE ADR PKE IND

PWEhigh

PWElow

PCD1

PCD2

BCC

Text block The text block is used to read or write texts via the data block.
STX LGE ADR PKE IND Ch1 Ch2 Chn PCD1 PCD2 BCC

72

MG02K102 - VLTp is a registered Danfoss trademark

RS485 Installation and Set-...

VLT Micro Drive Design Guide

8.4.7 The PKE Field


The PKE field contains two subfields: Parameter command and response (AK) and Parameter number (PNU):
130BB918.10

Error code 0 1 2 3 4 5 6 7 9

FC+ Specification. Illegal Parameter Number Parameter cannot be changed. Upper or lower limit exceeded Subindex corrupted No Array Wrong Data Type Not used Not used Description element not available No parameter write access No text available Not while Running Other error

PKE

IND

PWEhigh

PWElow

AK 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

PNU

11 15 17 18 100

Parameter commands and replies

Parameter number

>100 130 131 132 252 253 254 255 No bus access for this parameter Write to factory set-up not possible No LCP access Unknown viewer Request not supported Unknown attribute No error

Bits no. 12-15 transfer parameter commands from master to slave and return processed slave responses to the master.
Parameter commands master slave Bit no. 15 0 0 0 0 1 1 1 14 0 0 0 0 1 1 1 13 0 0 1 1 0 1 1 12 0 1 0 1 1 0 1 No command Read parameter value Write parameter value in RAM (word) Write parameter value in RAM (double word) Write parameter value in RAM and EEprom (double word) Write parameter value in RAM and EEprom (word) Read text Parameter command

8 8

8.4.8 Parameter Number (PNU)


Bits no. 0-11 transfer parameter numbers. The function of the relevant parameter is defined in the parameter description in the Programming Guide.

8.4.9 Index (IND)


The index is used together with the parameter number to read/write-access parameters with an index, e.g. 15-30 Alarm Log: Error Code. The index consists of 2 bytes; a low byte, and a high byte. Only the low byte is used as an index.

Response slave master Bit no. 15 0 0 0 0 1 14 0 0 0 1 1 13 0 0 1 1 1 12 0 1 0 1 1 No response Parameter value transferred (word) Parameter value transferred (double word) Command cannot be performed text transferred Response

8.4.10 Parameter Value (PWE)


The parameter value block consists of 2 words (4 bytes), and the value depends on the defined command (AK). The master prompts for a parameter value when the PWE block contains no value. To change a parameter value (write), write the new value in the PWE block and send from the master to the slave. When a slave responds to a parameter request (read command), the present parameter value in the PWE block is transferred and returned to the master. If a parameter contains several data options, e.g. 0-01 Language, select the data value by entering the value in the PWE block.

If the command cannot be performed, the slave sends this response: 0111 Command cannot be performed - and issues the following fault report in the parameter value:

MG02K102 - VLTp is a registered Danfoss trademark

73

RS485 Installation and Set-...

VLT Micro Drive Design Guide

Serial communication is only capable of reading parameters containing data type 9 (text string). 15-40 FC Type to 15-53 Power Card Serial Number contain data type 9. For example, read the unit size and mains voltage range in 15-40 FC Type. When a text string is transferred (read), the length of the telegram is variable, and the texts are of different lengths. The telegram length is defined in the second byte of the telegram (LGE). When using text transfer, the index character indicates whether it is a read or a write command. To read a text via the PWE block, set the parameter command (AK) to F Hex. The index character high-byte must be 4.

Conversion index 74 2 1 0 -1 -2 -3 -4 -5

Conversion factor 0.1 100 10 1 0.1 0.01 0.001 0.0001 0.00001

8.4.13 Process Words (PCD)


The block of process words is divided into two blocks of 16 bits, which always occur in the defined sequence.
PCD 1 Control telegram (master slave Control word) Control telegram (slave master) Status word PCD 2 Reference-value Present output frequency

8.4.11 Data Types Supported by the Frequency Converter

8 8

Unsigned means that there is no operational sign in the telegram.


Data types 3 4 5 6 7 9 Description Integer 16 Integer 32 Unsigned 8 Unsigned 16 Unsigned 32 Text string

8.5 Examples 8.5.1 Writing a Parameter Value


Change 4-14 Motor Speed High Limit [Hz] to 100Hz. Write the data in EEPROM. PKE = E19E Hex - Write single word in 4-14 Motor Speed High Limit [Hz]: IND = 0000 Hex PWEHIGH = 0000 Hex PWELOW = 03E8 Hex Data value 1000, corresponding to 100Hz, see 8.4.12 Conversion. The telegram looks like this:
130BA092.10

8.4.12 Conversion
The various attributes of each parameter are displayed in the section Factory Settings. Parameter values are transferred as whole numbers only. Conversion factors are therefore used to transfer decimals. 4-12 Motor Speed Low Limit [Hz] has a conversion factor of 0.1. To preset the minimum frequency to 10Hz, transfer the value 100. A conversion factor of 0.1 means that the value transferred is multiplied by 0.1. The value 100 is thus perceived as 10.0.

E19E PKE

H 0000 IND

H 0000 PWE high

H 03E8 PWE low

Note: 4-14 Motor Speed High Limit [Hz] is a single word, and the parameter command for write in EEPROM is E. Parameter number 4-14 is 19E in hexadecimal. The response from the slave to the master is:

74

MG02K102 - VLTp is a registered Danfoss trademark

RS485 Installation and Set-...

VLT Micro Drive Design Guide

119E PKE

H 0000 IND

H 0000 PWE high

H 03E8 PWE low

requests from another device, and how errors are detected and reported. It also establishes a common format for the layout and contents of message fields. During communications over a Modbus RTU network, the protocol determines: How each controller learns its device address

8.5.2 Reading a Parameter Value


Read the value in 3-41 Ramp 1 Ramp up Time PKE = 1155 Hex - Read parameter value in 3-41 Ramp 1 Ramp up Time IND = 0000 Hex PWEHIGH = 0000 Hex PWELOW = 0000 Hex
130BA094.10

130BA093.10

Recognizes a message addressed to it Determines which actions to take Extracts any data or other information contained in the message If a reply is required, the controller constructs the reply message and sends it. Controllers communicate using a master-slave technique in which only one device (the master) can initiate transactions (called queries). The other devices (slaves) respond by supplying the requested data to the master, or by taking the action requested in the query. The master can address individual slaves, or can initiate a broadcast message to all slaves. Slaves return a message (called a response) to queries that are addressed to them individually. No responses are returned to broadcast queries from the master. The Modbus RTU protocol establishes the format for the masters query by placing into it the device (or broadcast) address, a function code defining the requested action, any data to be sent, and an error-checking field. The slaves response message is also constructed using Modbus protocol. It contains fields confirming the action taken, any data to be returned, and an error-checking field. If an error occurs in receipt of the message, or if the slave is unable to perform the requested action, the slave will construct an error message, and send it in response, or a time-out occurs.

1155 PKE

H 0000 IND

0000 PWE high

H 0000 PWE low

If the value in 3-41 Ramp 1 Ramp up Time is 10 s, the response from the slave to the master is:
130BA267.10

8 8

1155 PKE

H 0000 IND

H 0000 PWE high

H 03E8 PWE low

3E8 Hex corresponds to 1000 decimal. The conversion index for 3-41 Ramp 1 Ramp up Time is -2, i.e. 0.01. 3-41 Ramp 1 Ramp up Time is of the type Unsigned 32.

8.6 Modbus RTU Overview 8.6.1 Assumptions


Danfoss assumes that the installed controller supports the interfaces in this document, and strictly observe all requirements and limitations stipulated in the controller and frequency converter.

8.6.4 Frequency Converter with Modbus RTU


The frequency converter communicates in Modbus RTU format over the built-in RS485 interface. Modbus RTU provides access to the Control Word and Bus Reference of the frequency converter. The Control Word allows the Modbus master to control several important functions of the frequency converter:

8.6.2 What the User Should Already Know


The Modbus RTU (Remote Terminal Unit) is designed to communicate with any controller that supports the interfaces defined in this document. It is assumed that the user has full knowledge of the capabilities and limitations of the controller.

Start Stop of the frequency converter in various ways: Coast stop Quick stop DC Brake stop Normal (ramp) stop Reset after a fault trip Run at a variety of preset speeds

8.6.3 Modbus RTU Overview


Regardless of the type of physical communication networks, the Modbus RTU Overview describes the process a controller uses to request access to another device. This process includes how the Modbus RTU responds to

MG02K102 - VLTp is a registered Danfoss trademark

75

RS485 Installation and Set-...

VLT Micro Drive Design Guide

Run in reverse Change the active set-up Control the frequency converters built-in relay

The Bus Reference is commonly used for speed control. It is also possible to access the parameters, read their values, and where possible, write values to them. This permits a range of control options, including controlling the setpoint of the frequency converter when its internal PI controller is used.

broadcast), and to recognise when the message is completed. Partial messages are detected and errors set as a result. Characters for transmission must be in hexadecimal 00 to FF format in each field. The frequency converter continuously monitors the network bus, also during silent intervals. When the first field (the address field) is received, each frequency converter or device decodes it to determine which device is being addressed. Modbus RTU messages addressed to zero are broadcast messages. No response is permitted for broadcast messages. A typical message frame is shown in Table 8.1.
Start T1-T2-T3T4 Address 8 bits Function 8 bits Data Nx8 bits CRC check 16 bits T1-T2-T3T4 End

8.7 Network Configuration


To enable Modbus RTU on the frequency converter, set the following parameters:
Parameter 8-30 Protocol 8-31 Address 8-32 Baud Rate Setting Modbus RTU 1 - 247 2400 - 115200 Even parity, 1 stop bit (default)

Table 8.1 Typical Modbus RTU Message Structure

8.8.3 Start/Stop Field


Messages start with a silent period of at least 3.5 character intervals. This is implemented as a multiple of character intervals at the selected network baud rate (shown as Start T1-T2-T3-T4). The first field to be transmitted is the device address. Following the last transmitted character, a similar period of at least 3.5 character intervals marks the end of the message. A new message can begin after this period. The entire message frame must be transmitted as a continuous stream. If a silent period of more than 1.5 character intervals occurs before completion of the frame, the receiving device flushes the incomplete message and assumes that the next byte will be the address field of a new message. Similarly, if a new message begins prior to 3.5 character intervals after a previous message, the receiving device will consider it a continuation of the previous message. This will cause a time-out (no response from the slave), since the value in the final CRC field will not be valid for the combined messages.

8 8

8-33 Parity / Stop Bits

8.8 Modbus RTU Message Framing Structure 8.8.1 Frequency Converter with Modbus RTU
The controllers are set up to communicate on the Modbus network using RTU (Remote Terminal Unit) mode, with each byte in a message containing 2 4-bit hexadecimal characters. The format for each byte is shown in Table 8.1.
Start bit Data byte Stop/ parity Stop

Coding System

8-bit binary, hexadecimal 0-9, A-F. 2 hexadecimal characters contained in each 8bit field of the message 1 start bit 8 data bits, least significant bit sent first 1 bit for even/odd parity; no bit for no parity 1 stop bit if parity is used; 2 bits if no parity

8.8.4 Address Field


The address field of a message frame contains 8 bits. Valid slave device addresses are in the range of 0 247 decimal. The individual slave devices are assigned addresses in the range of 1 247. (0 is reserved for broadcast mode, which all slaves recognize.) A master addresses a slave by placing the slave address in the address field of the message. When the slave sends its response, it places its own address in this address field to let the master know which slave is responding.

Bits Per Byte

Error Check Field

Cyclical Redundancy Check (CRC)

8.8.2 Modbus RTU Message Structure


The transmitting device places a Modbus RTU message into a frame with a known beginning and ending point. This allows receiving devices to begin at the start of the message, read the address portion, determine which device is addressed (or all devices, if the message is

8.8.5 Function Field


The function field of a message frame contains 8 bits. Valid codes are in the range of 1-FF. Function fields are used to send messages between master and slave. When a

76

MG02K102 - VLTp is a registered Danfoss trademark

RS485 Installation and Set-...

VLT Micro Drive Design Guide

message is sent from a master to a slave device, the function code field tells the slave what kind of action to perform. When the slave responds to the master, it uses the function code field to indicate either a normal (errorfree) response, or that some kind of error occurred (called an exception response). For a normal response, the slave simply echoes the original function code. For an exception response, the slave returns a code that is equivalent to the original function code with its most significant bit set to logic 1. In addition, the slave places a unique code into the data field of the response message. This tells the master what kind of error occurred, or the reason for the exception. Please also refer to the sections 8.8.10 Function Codes Supported by Modbus RTU and 8.8.11 Modbus Exception Codes.

Holding register 40001 is addressed as register 0000 in the data address field of the message. The function code field already specifies a holding register operation. Therefore, the 4XXXX reference is implicit. Holding register 40108 is addressed as register 006BHEX (107 decimal).
Coil Number 1-16 17-32 Frequency converter control word (see Table 8.2) Frequency converter speed or setpoint reference Range 0x0 0xFFFF (-200% ... ~200%) Table 8.2) 49-64 Open loop mode: Frequency converter output frequency Closed loop mode: Frequency converter feedback signal 65 Parameter write control (master to slave) 0= Parameter changes are written to the RAM of the frequency converter Parameter changes are written to the RAM and EEPROM of the frequency converter. Master to slave Slave to master Master to slave Master to slave Description Signal Direction

33-48

Frequency converter status word (see Slave to master

8.8.6 Data Field


The data field is constructed using sets of two hexadecimal digits, in the range of 00 to FF hexadecimal. These are made up of one RTU character. The data field of messages sent from a master to slave device contains additional information which the slave must use to take the action defined by the function code. This can include items such as coil or register addresses, the quantity of items to be handled, and the count of actual data bytes in the field.

8 8

1=

8.8.7 CRC Check Field


Messages include an error-checking field, operating on the basis of a Cyclical Redundancy Check (CRC) method. The CRC field checks the contents of the entire message. It is applied regardless of any parity check method used for the individual characters of the message. The CRC value is calculated by the transmitting device, which appends the CRC as the last field in the message. The receiving device recalculates a CRC during receipt of the message and compares the calculated value to the actual value received in the CRC field. If the two values are unequal, a bus timeout results. The error-checking field contains a 16-bit binary value implemented as two 8-bit bytes. When this is done, the low-order byte of the field is appended first, followed by the high-order byte. The CRC high-order byte is the last byte sent in the message.

66-6553 Reserved 6 Coil 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 No reversing Reversing 0 Preset reference LSB Preset reference MSB DC brake Coast stop Quick stop Freeze freq. Ramp stop No reset No jog Ramp 1 Data not valid Relay 1 off Relay 2 off Set up LSB No DC brake No coast stop No quick stop No freeze freq. Start Reset Jog Ramp 2 Data valid Relay 1 on Relay 2 on 1

8.8.8 Coil Register Addressing


In Modbus, all data are organized in coils and holding registers. Coils hold a single bit, whereas holding registers hold a 2-byte word (i.e. 16 bits). All data addresses in Modbus messages are referenced to zero. The first occurrence of a data item is addressed as item number zero. For example: The coil known as coil 1 in a programmable controller is addressed as coil 0000 in the data address field of a Modbus message. Coil 127 decimal is addressed as coil 007EHEX (126 decimal).

Table 8.2 Frequency Converter Control Word (FC Profile)

MG02K102 - VLTp is a registered Danfoss trademark

77

RS485 Installation and Set-...

VLT Micro Drive Design Guide

Coil 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

0 Control not ready Frequency converter not ready Coasting stop No alarm Not used Not used Not used No warning Not at reference Hand mode Out of freq. range Stopped Not used No voltage warning Not in current limit No thermal warning

1 Control ready Frequency converter ready Safety closed Alarm Not used Not used Not used Warning At reference Auto mode In frequency range Running Not used Voltage warning Current limit Thermal warning

Table 8.3 Frequency Converter status word (FC profile)

8 8

Bus adress Bus register1 PLC Register Content 0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 10 40001 40002 40003 40004 40005 40006 40007 40008 40009 40010 Reserved Reserved Reserved Free Free Modbus conf Last error code

Access

Description Reserved for Legacy Drives VLT 5000 and VLT 2800 Reserved for Legacy Drives VLT 5000 and VLT 2800 Reserved for Legacy Drives VLT 5000 and VLT 2800

Read/Write Read only

TCP only. Reserved for Modbus TCP (p12-28 and 12-29 store in Eeprom etc.) Error code recieved from parameter database, refer to WHAT 38295for details Address of register with which last error occurred, refer to WHAT 38296 for details Sub index of parameter to be accessed. Refer to WHAT 38297 for details Parameter 0-01 (Modbus Register = 10 parameter number 20 bytes space reserved pr parameter in Modbus Map Parameter 0-02 20 bytes space reserved pr parameter in Modbus Map Parameter 0-03 20 bytes space reserved pr parameter in Modbus Map

Last error register Read only Index pointer FC par. 0-01 Read/Write Dependent on parameter access Dependent on parameter access Dependent on parameter access

19 29

20 30

40020 40030

FC par. 0-02 FC par. xx-xx

Value written in Modbus RTU telegram must be one or less than register number. E.g. Read Modbus Register 1 by writing value 0 in telegram.

* Used to specify the index number to be used when accessing an indexed parameter.

78

MG02K102 - VLTp is a registered Danfoss trademark

RS485 Installation and Set-...

VLT Micro Drive Design Guide

8.8.9 How to Control the Frequency Converter


This section describes codes which can be used in the function and data fields of a Modbus RTU message.

Modbus Exception Codes


2 Illegal data address 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 generate exception 02. 3 Illegal data value A value contained in the query data field is not an allowable value for 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 a 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 attempting to perform the requested action.

8.8.10 Function Codes Supported by Modbus RTU


Modbus RTU supports use of the following function codes in the function field of a message.
Function Read coils Read holding registers Write single coil Write single register Write multiple coils Write multiple registers Get comm. event counter Report slave ID Function Function Code Subfunction code 1 2 10 11 12 13 14 Function Code 1 hex 3 hex 5 hex 6 hex F hex 10 hex B hex 11 hex Sub-function

8 8

Diagnostic 8 s

Restart communication Return diagnostic register Clear counters and diagnostic register Return bus message count Return bus communication error count Return bus exception error count Return slave message count

8.9 How to Access Parameters 8.9.1 Parameter Handling


The PNU (Parameter Number) is translated from the register address contained in the Modbus read or write message. The parameter number is translated to Modbus as (10 x parameter number) DECIMAL.

8.9.2 Storage of Data


The Coil 65 decimal determines whether data written to the frequency converter are stored in EEPROM and RAM (coil 65 = 1) or only in RAM (coil 65 = 0).

8.8.11 Modbus Exception Codes


For a full explanation of the structure of an exception code response, please refer to 8.8.5 Function Field. Modbus Exception Codes
Co Name de 1 Illegal function Meaning The function code received in the query is not an allowable action for the server (or slave). This may be because the function code is only applicable to newer devices, and was not implemented in the unit selected. It could also indicate that the server (or slave) is in the wrong state to process a request of this type, for example because it is not configured and is being asked to return register values.

8.9.3 IND
The array index is set in Holding Register 9 and used when accessing array parameters.

8.9.4 Text Blocks


Parameters stored as text strings are accessed in the same way as the other parameters. The maximum text block size is 20 characters. If a read request for a parameter is for more characters than the parameter stores, the response is truncated. If the read request for a parameter is for fewer characters than the parameter stores, the response is space filled.

MG02K102 - VLTp is a registered Danfoss trademark

79

RS485 Installation and Set-...

VLT Micro Drive Design Guide

8.9.5 Conversion Factor


The different attributes for each parameter can be seen in the section on factory settings. Since a parameter value can only be transferred as a whole number, a conversion factor must be used to transfer decimals. Please refer to the 7.4 Quick Menu Parameters.

Field Name Slave Address Function Starting Address HI Starting Address LO No. of Points HI No. of Points LO Error Check (CRC)

Example (HEX) 01 (frequency converter address) 01 (read coils) 00 20 (32 decimals) Coil 33 00 10 (16 decimals) -

8.9.6 Parameter Values


Standard Data Types Standard data types are int16, int32, uint8, uint16 and uint32. They are stored as 4x registers (40001 4FFFF). The parameters are read using function 03HEX "Read Holding Registers." Parameters are written using the function 6HEX "Preset Single Register" for 1 register (16 bits), and the function 10HEX "Preset Multiple Registers" for 2 registers (32 bits). Readable sizes range from 1 register (16 bits) up to 10 registers (20 characters). Response The coil status in the response message is packed as one coil per bit of the data field. Status is indicated as: 1 = ON; 0 = OFF. The LSB of the first data byte contains the coil addressed in the query. The other coils follow toward the high order end of this byte, and from low order to high order in subsequent bytes. If the returned coil quantity is not a multiple of eight, the remaining bits in the final data byte will be padded with zeros (toward the high order end of the byte). The Byte Count field specifies the number of complete bytes of data.
Field Name Slave Address Function Byte Count Data (Coils 40-33) Data (Coils 48-41) Error Check (CRC) Example (HEX) 01 (frequency converter address) 01 (read coils) 02 (2 bytes of data) 07 06 (STW=0607hex) -

8 8

Non standard Data Types Non standard data types are text strings and are stored as 4x registers (40001 4FFFF). The parameters are read using function 03HEX "Read Holding Registers" and written using function 10HEX "Preset Multiple Registers." Readable sizes range from 1 register (2 characters) up to 10 registers (20 characters).

8.10 Examples
The following examples illustrate various Modbus RTU commands. If an error occurs, please refer to 8.8.11 Modbus Exception Codes.

NOTE
Coils and registers are addressed explicit with an off-set of -1 in Modbus. I.e. Coil 33 is addressed as Coil 32.

8.10.1 Read Coil Status (01 HEX) 8.10.2 Force/Write Single Coil (05 HEX)
Description This function reads the ON/OFF status of discrete outputs (coils) in the frequency converter. Broadcast is never supported for reads. Query The query message specifies the starting coil and quantity of coils to be read. Coil addresses start at zero, i.e. coil 33 is addressed as 32. Example of a request to read coils 33-48 (Status Word) from slave device 01. Description This function forces the coil to either ON or OFF. When broadcast the function forces the same coil references in all attached slaves. Query The query message specifies the coil 65 (parameter write control) to be forced. Coil addresses start at zero, i.e. coil 65 is addressed as 64. Force Data = 00 00HEX (OFF) or FF 00HEX (ON).
Field Name Slave Address Function Coil Address HI Coil Address LO Force Data HI Force Data LO Error Check (CRC) Example (HEX) 01 (frequency converter address) 05 (write single coil) 00 40 (64 decimal) Coil 65 FF 00 (FF 00 = ON) -

80

MG02K102 - VLTp is a registered Danfoss trademark

RS485 Installation and Set-...

VLT Micro Drive Design Guide

Response The normal response is an echo of the query, returned after the coil state has been forced.
Field Name Slave Address Function Force Data HI Force Data LO Quantity of Coils HI Quantity of Coils LO Error Check (CRC) Example (HEX) 01 05 FF 00 00 01 -

8.10.4 Read Holding Registers (03 HEX)


Description This function reads the contents of holding registers in the slave. Query The query message specifies the starting register and quantity of registers to be read. Register addresses start at zero, i.e. registers 1-4 are addressed as 0-3. Example: Read 3-03 Maximum Reference, register 03030.
Field Name Example (HEX) 01 03 (read holding registers) 0B (Register address 3029) 05 (Register address 3029) 00 02 - (3-03 Maximum Reference is 32 bits long, i.e. 2 registers) Error Check (CRC) -

8.10.3 Force/Write Multiple Coils (0F HEX)


This function forces each coil in a sequence of coils to either ON or OFF. When broadcast the function forces the same coil references in all attached slaves. The query message specifies the coils 17 to 32 (speed setpoint) to be forced.

Slave Address Function Starting Address HI Starting Address LO No. of Points HI No. of Points LO

8 8

NOTE
Coil addresses start at zero, i.e. coil 17 is addressed as 16.
Field Name Slave Address Function Coil Address HI Coil Address LO Quantity of Coils HI Quantity of Coils LO Byte Count Force Data HI (Coils 8-1) Force Data LO (Coils 10-9) Error Check (CRC) Example (HEX) 01 (frequency converter address) 0F (write multiple coils) 00 10 (coil address 17) 00 10 (16 coils) 02 20 00 (ref. = 2000hex)

Response The register data in the response message are packed as two bytes per register, with the binary contents right justified within each byte. For each register, the first byte contains the high-order bits and the second contains the low-order bits. Example: Hex 000088B8 = 35.000 = 15Hz.
Field Name Slave Address Function Byte Count Data HI (Register 3030) Data LO (Register 3030) Data HI (Register 3031) Data LO (Register 3031) Error Check (CRC) 16 E3 60 Example (HEX) 01 03 04 00

Response The normal response returns the slave address, function code, starting address, and quantity of coils forced.
Field Name Slave Address Function Coil Address HI Coil Address LO Quantity of Coils HI Quantity of Coils LO Error Check (CRC) Example (HEX) 01 (frequency converter address) 0F (write multiple coils) 00 10 (coil address 17) 00 10 (16 coils) -

8.10.5 Preset Single Register (06 HEX)


Description This function presets a value into a single holding register. Query The query message specifies the register reference to be preset. Register addresses start at zero, i.e. register 1 is addressed as 0. Example: Write to 1-00 Configuration Mode, register 1000.

MG02K102 - VLTp is a registered Danfoss trademark

81

RS485 Installation and Set-...

VLT Micro Drive Design Guide

Field Name Slave Address Function Register Address HI Register Address LO Preset Data HI Preset Data LO Error Check (CRC)

Example (HEX) 01 06 03 (Register address 999) E7 (Register address 999) 00 01 -

Field Name Slave Address Function Starting Address HI Starting Address LO No. of Registers HI No. of registers LO Error Check (CRC)

Example (HEX) 01 10 04 19 00 02 -

Response The normal response is an echo of the query, returned after the register contents have been passed.
Field Name Slave Address Function Register Address HI Register Address LO Preset Data HI Preset Data LO Error Check (CRC) Example (HEX)

8.11 Danfoss FC Control Profile 8.11.1 Control Word According to FC Profile (8-10 Protocol = FC profile)
Master-slave CTW Speed ref. 130BA274.10

01 06 03 E7 00 01 Bit
Bit no.:

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

8 8

Bit value = 0 Reference value Reference value DC brake Coasting Quick stop Hold output frequency Ramp stop No function No function Ramp 1 Data invalid Relay 01 open Relay 02 open Parameter set-up No function

Bit value = 1 external selection lsb external selection msb Ramp No coasting Ramp use ramp Start Reset Jog Ramp 2 Data valid Relay 01 active Relay 02 active selection lsb Reverse

8.10.6 Preset Multiple Registers (10 HEX)


Description This function presets values into a sequence of holding registers. Query The query message specifies the register references to be preset. Register addresses start at zero, i.e. register 1 is addressed as 0. Example of a request to preset two registers (set 1-24 Motor Current to 738 (7.38 A)):
Field Name Slave Address Function Starting Address HI Starting Address LO No. of Registers HI No. of registers LO Byte Count Write Data HI (Register 4: 1049) Write Data LO (Register 4: 1049) Write Data HI (Register 4: 1050) Write Data LO (Register 4: 1050) Error Check (CRC) E2 02 Example (HEX) 01 10 04 19 00 02 04 00 00

00 01 02 03 04 05 06 07 08 09 10 11 12 13 15

Explanation of the Control Bits Bits 00/01 Bits 00 and 01 are used to choose between the four reference values, which are pre-programmed in 3-10 Preset Reference according to the Table 8.4:

Response The normal response returns the slave address, function code, starting address, and quantity of registers preset.

82

MG02K102 - VLTp is a registered Danfoss trademark

RS485 Installation and Set-...

VLT Micro Drive Design Guide

Programmed ref. Parameter value 1 2 3 4 3-10 Preset Reference [0] 3-10 Preset Reference [1] 3-10 Preset Reference [2] 3-10 Preset Reference [3]

Bit 01 0 0 1 1

Bit 00 0 1 0 1

Bit 06, Ramp stop/start Bit 06 = 0: Causes a stop and makes the motor speed ramp down to stop via the selected ramp down parameter. Bit 06 = 1: Permits the frequency converter to start the motor, if the other starting conditions are met. Make a selection in 8-53 Start Select to define how Bit 06 Ramp stop/start gates with the corresponding function on a digital input. Bit 07, Reset Bit 07 = 0: No reset. Bit 07 = 1: Resets a trip. Reset is activated on the signals leading edge, i.e. when changing from logic 0 to logic 1. Bit 08, Jog Bit 08 = 1: The output frequency is determined by 3-11 Jog Speed [Hz]. Bit 09, Selection of ramp 1/2 Bit 09 = "0": Ramp 1 is active (3-41 Ramp 1 Ramp up Time to 3-42 Ramp 1 Ramp Down Time). Bit 09 = "1": Ramp 2 (3-51 Ramp 2 Ramp up Time to 3-52 Ramp 2 Ramp down Time) is active. Bit 10, Data not valid/Data valid Tell the frequency converter whether to use or ignore the control word. Bit 10 = 0: The control word is ignored. Bit 10 = 1: The control word is used. This function is relevant because the telegram always contains the control word, regardless of the telegram type. Thus, you can turn off the control word if you do not want to use it when updating or reading parameters. Bit 11, Relay 01 Bit 11 = "0": Relay not activated. Bit 11 = "1": Relay 01 activated provided that Control word bit 11 is chosen in 5-40 Function Relay. Bit 12, Relay 02 Bit 12 = "0": Relay 02 is not activated. Bit 12 = "1": Relay 02 is activated provided that Control word bit 12 is chosen in 5-40 Function Relay. Bit 13, Selection of set-up Use bits 13 to choose from the 2 menu set-ups according to the shown table.
Set-up 1 2 Bit 13 0 1

NOTE
Make a selection in 8-56 Preset Reference Select to define how Bit 00/01 gates with the corresponding function on the digital inputs. Bit 02, DC brake Bit 02 = 0 leads to DC braking and stop. Set braking current and duration in 2-01 DC Brake Current and 2-02 DC Braking Time. Bit 02 = 1 leads to ramping. Bit 03, Coasting Bit 03 = 0: The frequency converter immediately "lets go" of the motor, (the output transistors are "shut off") and it coasts to a standstill. Bit 03 = 1: The frequency converter starts the motor if the other starting conditions are met. Make a selection in 8-50 Coasting Select to define how Bit 03 gates with the corresponding function on a digital input. Bit 04, Quick stop Bit 04 = 0: Makes the motor speed ramp down to stop (set in 3-81 Quick Stop Ramp Time). Bit 05, Hold output frequency Bit 05 = 0: The present output frequency (in Hz) freezes. Change the frozen output frequency only by means of the digital inputs (5-10 Terminal 18 Digital Input to 5-13 Terminal 29 Digital Input) programmed to Speed up and Slow down.

8 8

NOTE
If Freeze output is active, the frequency converter can only be stopped by the following:

Bit 03 Coasting stop Bit 02 DC braking Digital input (5-10 Terminal 18 Digital Input to 5-13 Terminal 29 Digital Input) programmed to DC braking, Coasting stop, or Reset and coasting stop.

The function is only possible when Multi Set-Ups is selected in 0-10 Active Set-up.

MG02K102 - VLTp is a registered Danfoss trademark

83

RS485 Installation and Set-...

VLT Micro Drive Design Guide

Make a selection in 8-55 Set-up Select to define how Bit 13 gates with the corresponding function on the digital inputs. Bit 15 Reverse Bit 15 = 0: No reversing. Bit 15 = 1: Reversing. In the default setting, reversing is set to digital in 8-54 Reversing Select. Bit 15 causes reversing only when Ser. communication, Logic or Logic and is selected.

Bit 03, No error/trip Bit 03 = 0 : The frequency converter is not in fault mode. Bit 03 = 1: The frequency converter trips. To re-establish operation, enter [Reset]. Bit 04, No error/error (no trip) Bit 04 = 0: The frequency converter is not in fault mode. Bit 04 = 1: The frequency converter shows an error but does not trip. Bit 05, Not used Bit 05 is not used in the status word.

8.11.2 Status Word According to FC Profile (STW) (8-30 Protocol = FC profile)


Slave-master STW Output freq. 130BA273.10

Bit 06, No error / triplock Bit 06 = 0: The frequency converter is not in fault mode. Bit 06 = 1: The frequency converter is tripped and locked. Bit 07, No warning/warning Bit 07 = 0: There are no warnings. Bit 07 = 1: A warning has occurred.

Bit no.:

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

8 8

Bit 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15

Bit = 0 Control not ready Drive not ready Coasting No error No error Reserved No error No warning Speed reference Local operation Out of frequency limit No operation Drive OK Voltage OK Torque OK Timer OK

Bit = 1 Control ready Drive ready Enable Trip Error (no trip) Triplock Warning Speed = reference Bus control Frequency limit OK In operation Stopped, auto start Voltage exceeded Torque exceeded Timer exceeded

Bit 08, Speed reference/speed = reference Bit 08 = 0: The motor is running but the present speed is different from the preset speed reference. It might e.g. be the case when the speed ramps up/down during start/ stop. Bit 08 = 1: The motor speed matches the preset speed reference. Bit 09, Local operation/bus control Bit 09 = 0: [STOP/RESET] is activate on the control unit or Local control in F-02 Operation Method is selected. You cannot control the frequency converter via serial communication. Bit 09 = 1 It is possible to control the frequency converter via the fieldbus / serial communication. Bit 10, Out of frequency limit Bit 10 = 0: The output frequency has reached the value in 4-12 Motor Speed Low Limit [Hz] or 4-14 Motor Speed High Limit [Hz]. Bit 10 = "1": The output frequency is within the defined limits. Bit 11, No operation/in operation Bit 11 = 0: The motor is not running. Bit 11 = 1: The frequency converter has a start signal or the output frequency is greater than 0Hz. Bit 12, Drive OK/stopped, autostart: Bit 12 = 0: There is no temporary over temperature on the inverter. Bit 12 = 1: The inverter stops because of over temperature but the unit does not trip and will resume operation once the over temperature stops.

Explanation of the Status Bits Bit 00, Control not ready/ready Bit 00 = 0: The frequency converter trips. Bit 00 = 1: The frequency converter controls are ready but the power component does not necessarily receive any power supply (in case of external 24V supply to controls). Bit 01, Drive ready Bit 01 = 1: The frequency converter is ready for operation but the coasting command is active via the digital inputs or via serial communication. Bit 02, Coasting stop Bit 02 = 0: The frequency converter releases the motor. Bit 02 = 1: The frequency converter starts the motor with a start command.

84

MG02K102 - VLTp is a registered Danfoss trademark

RS485 Installation and Set-...

VLT Micro Drive Design Guide

Bit 13, Voltage OK/limit exceeded Bit 13 = 0: There are no voltage warnings. Bit 13 = 1: The DC voltage in the frequency converters intermediate circuit is too low or too high. Bit 14, Torque OK/limit exceeded Bit 14 = 0: The motor current is lower than the torque limit selected in 4-18 Current Limit. Bit 14 = 1: The torque limit in 4-18 Current Limit is exceeded.

Bit 15, Timer OK/limit exceeded Bit 15 = 0: The timers for motor thermal protection and thermal protection are not exceeded 100%. Bit 15 = 1: One of the timers exceeds 100%.

8.11.3 Bus Speed Reference Value


Speed reference value is transmitted to the frequency converter in a relative value in %. The value is transmitted in the form of a 16-bit word; in integers (0-32767) the value 16384 (4000 Hex) corresponds to 100%. Negative figures are formatted by means of 2s complement. The Actual Output frequency (MAV) is scaled in the same way as the bus reference.
Master-slave 16bit CTW Speed ref. 130BA276.10

Slave-master STW Actual output freq.

8 8

The reference and MAV are scaled as follows:


-100% (C000hex) 0% (0hex) 100% (4000hex) 130BA277.10

Par.3-00 set to Reverse (1) -max- +max Forward

Par.3-03 Max reference

Par.3-03 Max reference

0% (0hex)

100% (4000hex)

Par.3-00 set to Forward (0) min-max

Par.3-02 Min reference

Par.3-03 Max reference

MG02K102 - VLTp is a registered Danfoss trademark

85

You might also like