4 How to Control
4.1 How to Control the Frequency
Converter
This section describes codes which can be used in the
function and data fields of a Modbus TCP message. For a
complete description of all the message fields, refer to
4.2 Modbus TCP Message Framing Structure
4.1.1 Function Codes Supported by
Modbus TCP
Modbus TCP supports use of the following function codes
in the function field of a message
Function
Function code
Read holding registers
3 hex
Write single register
6 hex
Write multiple registers
10 hex
Get comm. event counter
B hex
Report slave ID
11 hex
Read/Write multiple registers
17 hex
Table 4.1 Function Codes
Function
Function
code
Sub-function
code
Sub-function
Diagnostics 8
1
Restart communication
2
Return diagnostic
register
10
Clear counters and
diagnostic register
11
Return bus message
count
12
Return bus communi-
cation error count
13
Return bus exception
error count
14
Return slave message
count
Table 4.2 Subfunction Codes
4.2 Modbus TCP Message Framing
Structure
4.2.1 Function Code
The function code of a message frame contains 8 bits.
Valid codes are in the range of 1-FF. Use function codes to
send messages between master and slave. When a
message is sent from a master to a slave device, the
function code tells the slave what action to perform. When
the slave responds to the master, it uses the function code
to indicate either a normal (error-free) response, or that
some error occurred (called an exception response). For a
normal response, the slave 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 error occurred, or the
reason for the exception. Refer also to sections
4.1.1 Function Codes Supported by Modbus TCP
and
.
4.2.2 Data Field
The data field is constructed using sets of two hexadecimal
digits, in the range of 00 to FF hexadecimal. These digits
are made up of one TCP 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.
4.2.3 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. Example: Reading
3-12 Catch up/slow Down Value
(16bit): The holding register
3120 holds the parameters value. A value of 1352
(Decimal), means that the parameter is set to 12.52%
Reading
3-14 Preset Relative Reference
(32bit): The holding
registers 3410 & 3411 holds the parameters value. A value
of 11300 (Decimal), means that the parameter is set to
1113.00 S.
For information on the parameters, size and converting
index, consult the product relevant programming guide.
4.2.4 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).
How to Control
MCA 122 Modbus TCP
MG90P202 - VLT
®
is a protected Danfoss trademark
17
4
4