MFC 400 Supplementary instructions
Signal converter for mass flowmeters
Description of Modbus interface
Electronic Revision: ER 1.0.3_
Modbus version 2.1.0_
© KROHNE 05/2013 - 4002525102 - AD Modbus MFC 400 R02 en
|
CONTENTS |
MFC 400 |
|
|
|
||
|
|
|
|
1 General information |
4 |
||
|
|
|
|
1.1 |
Scope of the document..................................................................................................... |
4 |
|
1.2 |
Scope of delivery............................................................................................................... |
4 |
|
1.3 |
Modbus protocol interface ............................................................................................... |
4 |
|
2 Technical data |
5 |
||
|
|
|
|
2.1 |
General technical data ..................................................................................................... |
5 |
|
2.2 |
Technical data of the Modbus interface (acc. to EIA/TIA standards) .............................. |
5 |
|
3 Electrical connections |
6 |
||
|
|
|
|
3.1 |
Modbus connection........................................................................................................... |
6 |
|
3.2 |
Connection to Modbus bus ............................................................................................... |
6 |
|
4 Establish RS485 connection |
7 |
||
|
|
||
5 Modbus protocol |
8 |
||
|
|
|
|
5.1 |
RTU frame format............................................................................................................. |
8 |
|
5.2 |
Data representation ......................................................................................................... |
9 |
|
5.2.1 |
8-bit values.............................................................................................................................. |
9 |
|
5.2.2 |
16-bit values............................................................................................................................ |
9 |
|
5.2.3 |
32-bit values............................................................................................................................ |
9 |
|
5.2.4 |
64-bit values.......................................................................................................................... |
10 |
|
5.3 |
Modbus Register Addresses .......................................................................................... |
11 |
|
5.4 |
Supported Function Codes ............................................................................................. |
11 |
|
5.5 |
Error messages.............................................................................................................. |
11 |
|
5.6 |
Device identification ....................................................................................................... |
12 |
|
5.7 |
Diagnostics ..................................................................................................................... |
13 |
|
5.8 |
Parameters..................................................................................................................... |
13 |
|
5.8.1 Device Control....................................................................................................................... |
14 |
||
5.8.2 Device Status......................................................................................................................... |
15 |
||
5.8.3 Measurement values ............................................................................................................ |
16 |
||
5.8.4 Measurement Status compliant with NAMUR NE 107 ......................................................... |
16 |
||
5.8.5 |
Auxiliary Values..................................................................................................................... |
17 |
|
5.8.6 |
Totaliser ................................................................................................................................ |
17 |
|
5.8.7 Zero Calibration .................................................................................................................... |
20 |
||
5.8.8 |
Density Calibration Coefficients ........................................................................................... |
21 |
|
5.8.9 Density Configuration ........................................................................................................... |
21 |
||
5.8.10 Filters .................................................................................................................................. |
22 |
||
5.8.11 System Control.................................................................................................................... |
22 |
||
5.8.12 Calibration Coefficients ...................................................................................................... |
23 |
||
5.8.13 Modbus RS485 Communication Settings ........................................................................... |
24 |
||
5.8.14 NAMUR NE 107 Variable Event Group(s)............................................................................ |
25 |
||
5.8.15 Concentration 1................................................................................................................... |
26 |
||
5.8.16 Concentration 2................................................................................................................... |
27 |
2 |
www.krohne.com |
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
|
|
|
|
CONTENTS |
|
|
|
|
MFC 400 |
|
|
||||
|
|
|
|
|
|
||
6 |
Application sequences |
28 |
|
||||
|
|
|
|
|
|
|
|
|
|
|
6.1 |
Saving and restoring the configuration setting ............................................................. |
28 |
|
|
|
|
|
6.2 |
Zero calibration .............................................................................................................. |
29 |
||
7 |
Troubleshooting |
30 |
|
||||
|
|
|
|
|
|
|
|
|
|
|
7.1 |
No response to Modbus requests .................................................................................. |
30 |
|
|
|
|
|
7.2 |
Communication errors ................................................................................................... |
30 |
||
|
|
|
7.3 |
Responding with exception "Illegal Function"............................................................... |
30 |
|
|
|
|
|
7.4 |
Responding with exception "Illegal Data Address" ....................................................... |
31 |
|
|
|
|
|
7.5 |
Responding with exception "Illegal Data Value"............................................................ |
31 |
|
|
8 |
Appendix |
32 |
|
||||
|
|
|
|
|
|
|
|
|
|
|
8.1 |
NAMUR NE 107 Event Group(s)...................................................................................... |
32 |
|
|
|
|
|
8.2 |
NAMUR NE 107 status signals ....................................................................................... |
33 |
||
|
|
|
8.3 |
Supported Modbus function codes................................................................................. |
33 |
|
|
|
|
|
8.4 |
Number format............................................................................................................... |
36 |
||
|
|
|
8.5 |
Glossary .......................................................................................................................... |
36 |
||
9 |
Notes |
|
37 |
|
|||
|
|
|
|
|
|
|
|
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
www.krohne.com |
3 |
1 GENERAL INFORMATION |
|
|
MFC 400 |
|
|
|
|
|
1.1 Scope of the document
These instructions are supplementary to the signal converter handbook. For all other data, use the relevant chapters of the handbook. If you do not have this document, please contact the nearest office or download them from the manufacturer's internet site.
1.2 Scope of delivery
The information in this supplementary manual only contains the data applicable to MODBUS communication.
The technical data in the handbook shall be valid in its current version, provided that it is not rendered invalid or replaced by this supplement.
1.3 Modbus protocol interface
The Modbus interface to the signal converter is implemented in the Modbus RTU communications protocol and is done in accordance with the specification and requirements of the "Modbus Protocol Specification V1.1b".
The physical electrical parameters of the Modbus specification are defined by the EIA/TIA-485 (RS485) standard and the "Modbus over Serial Line - Specification and Implementation Guide V1.02".
Both specifications can be obtained on the official website of the Modbus organisation:
http://www.modbus.org
4 |
www.krohne.com |
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
|
|
|
|
TECHNICAL DATA 2 |
|
MFC 400 |
|
||
|
2.1 General technical data |
|
|
|
|
|
|
||
|
|
|
|
|
|
|
Interface |
RS485, galvanically isolated |
|
|
|
|
|
|
|
|
Baud rate |
1200, 2400, 3600, 4800, 9600, 19200, 38400, 57600 or |
|
|
|
|
115200 bps |
|
|
|
|
|
|
|
|
Protocol |
Modbus RTU (available as a separate document on request) |
|
|
|
|
|
|
|
|
Maximum participants on bus |
32 per line, master included (may be extended by repeaters) |
|
|
|
|
|
|
|
|
Coding |
NRZ bit coding |
|
|
|
|
|
|
|
|
Address range |
1...247 |
|
|
|
|
|
|
|
|
Transmission procedure |
Half duplex, asynchronous |
|
|
|
|
|
|
|
|
Bus access |
Master / slave |
|
|
|
|
|
|
|
|
Cable |
Screened twisted pair |
|
|
|
|
|
|
|
|
Distances |
Maximum 1.2 km / 3937 ft without repeater (dependant on |
|
|
|
|
baud rate and cable specifications) |
|
|
|
|
|
|
2.2 Technical data of the Modbus interface (acc. to EIA/TIA standards)
Kind of signal transmission |
Differential, 2-wire topology |
|
|
Maximum number of |
32 |
transmitter/receivers |
|
|
|
Voltage range on converter input |
-7...+12 V |
|
|
Maximum voltage on converter output |
5 V |
|
|
Minimum voltage on driver output, max. |
Udiff > 1.5 V |
load |
|
Maximum input current (off state) |
-20...+20 μA |
|
|
Receiver input voltage |
-7...+12 V |
|
|
Sensitivity of the receiver |
-200...+200 mV |
|
|
Receiver input resistance |
> 12 kΩ |
|
|
Short circuit current |
< 250 mA |
|
|
Termination / polarization resistors |
120 Ω / 560 Ω |
(if activated by factory) |
|
|
|
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
www.krohne.com |
5 |
3 ELECTRICAL CONNECTIONS |
|
|
MFC 400 |
|
|
|
|
|
3.1 Modbus connection
The signal converter is hooked up onto the bus using terminals C and D:
Terminals |
Description |
|
|
D- |
Signal A (D 0) |
|
|
D |
Signal B (D 1) |
|
|
C- |
Common 0 V |
|
|
C |
Not connected |
|
|
Terminals A and B of the signal converter are dependant on the options selected at order. Refer to the standard handbook of the signal converter for connection details.
3.2 Connection to Modbus bus
The signal converter is designed to be connected as a slave device onto the 2-wire bus implementation of the Modbus serial physical layer definition.
In addition to the D0 and D1 signal lines the bus MUST include a "Common" signal line to act as a ground reference point for the data signals.
For proper operation of Modbus in half duplex mode in single or multi-drop communication, it is recommended that a termination resistor is applied to both ends of the data line. The simplest form of termination is line-to-line resistor across the differential input.
In RTU mode the Modus protocol requires quiet periods on the communications bus for synchronisation. It is therefore important that the Modbus is not allowed to "float", i.e. unreferenced to 0 V, as this could lead to spurious signals due to noise pick-up. It is therefore necessary to employ biasing resistors at one point on the bus network.
6 |
www.krohne.com |
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
|
|
ESTABLISH RS485 CONNECTION 4 |
|
MFC 400 |
|
|
|
|
To establish a RS485 connection with the signal converter, prepare the master device with the appropriate default settings or use custom parameters specified via display of the signal converter.
The Modbus RS485 settings can be found in the menu C6.8 of the display. The following parameters can be configured:
Parameter |
Legal values |
Default values |
Display Fct. No. |
|
|
|
|
Slave address |
1...247 |
1 |
C6.8.1 |
|
|
|
|
"Baude rate" |
1200, 2400, 3600, 4800, 9600, |
19200 bps |
C6.8.2 |
|
19200, 38400, 57600, 115200 |
|
|
|
bps |
|
|
|
|
|
|
Parity |
Even, Odd, No |
Even Parity |
C6.8.3 |
|
|
|
|
Data format |
Big Endian, Little Endian |
Big Endian |
C6.8.4 |
|
|
|
|
Transmission |
0...0.04 [s] |
0 s |
C6.8.5 |
delay |
|
|
|
|
|
|
|
Stop Bits |
1 Stop Bit, 2 Stop Bits |
1 Stop Bit |
C6.8.6 |
|
|
|
|
These settings can be changed via Modbus too. For further information refer to Modbus RS485 Communication Settings on page 24.
All devices connected to the bus, must have the same baud rate.
INFORMATION!
It is of great importance to ensure at the time of the procedure of devices addressing, that there are not two devices with the same address. In such a case, an abnormal behaviour of the whole serial bus can occur. It is then impossible for the master to communicate with all present slaves on the bus.
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
www.krohne.com |
7 |
5 MODBUS PROTOCOL
5.1 RTU frame format
MFC 400
Using RTU (Remote Terminal Unit) format, data is transmitted as 8 bit binary characters. There are no special characters to determine the start and end of a message frame. Synchronization is achieved by a minimum silent period of at least 3.5 character times before the start of each frame transmission and a maximum silent period of 1.5 character times between characters in the same frame.
The format of the query and response frames vary slightly depending upon the function code. The basic form is outlined below.
Command function |
Frame format |
Description |
|
|
|
Silent period |
3.5 x T |
All transmissions must be preceded by a minimum silent |
|
|
period of 3.5 x T, where T is the transmission time of a |
|
|
single character. This can be calculated from the baud |
|
|
rate, e.g. T = 572 µs at 19.2 kbps. |
Slave address |
8 bits |
This is a single byte slave address which is transmitted |
|
|
first and must be in the range of 1...247. Address 0 is |
|
|
reserved for a broadcast address which all slaves should |
|
|
recognise, and therefore requires no response. |
|
|
|
Function code |
8 bits |
This is an eight bit code in the range of 1...255 although |
|
|
only 126 functions exist as the codes 129...255 represent |
|
|
an error condition. An error condition occurs when the |
|
|
addressed slave does not accept the command, in which |
|
|
case it responds with the function code + 128, i.e. with its |
|
|
msb set to 1. |
|
|
|
Register start address or |
8 bit byte count |
Register start address: for a query command that requires |
byte count when required |
16 bit address |
data to be returned, this field will contain the 16 bit start |
|
|
address of the register (or data) to be returned. |
|
|
Note that the signal converter uses protocol addresses. |
|
|
Therefore the register address listed is the actual number |
|
|
required in the Modbus command. |
|
|
E.g: to access input register 30006, the register start |
|
|
address is 30006 = 0x7536. |
|
|
Byte count: In general this is only present in frames that |
|
|
are transferring data, and has a value equal to the number |
|
|
of bytes contained in the data field. The data field is limited |
|
|
to a maximum of 250 bytes. |
|
|
|
Number of points or data |
n × 8 bits |
Number of points: for a query command that requires data |
bytes when required |
|
to be returned, this field will contain the number of |
|
|
registers to be returned regardless of their bit size. |
|
|
Data bytes: contains the data requested. The signal |
|
|
converter can use Big Endian format (MSB first) or Little |
|
|
Endian format (LSB first). |
|
|
|
CRC |
16 bits |
This field contains a 16 bit CRC which is calculated on all |
|
|
the data bits of the message bytes. |
|
|
|
8 |
www.krohne.com |
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
|
|
MODBUS PROTOCOL 5 |
|
MFC 400 |
|
|
|
|
5.2 Data representation
There are two data types used to transmit information on a Modbus data bus, the "Bit" and the "Register". The "Bit" represents a single binary state, whether as an output or an input condition. The "Register" is a 16-bit integer transmitted as two 8-bit characters. Using multiple "Registers" the Modbus interface can transmit higher accuracy values such as "Floating Point" and "Double Precision Floating Point" numbers.
"Bit" variables are packed into a byte containing 8 bit, so each character, sent or received, can contain up to 8 "Bit" variables. The master and slave devices use only as many 8 bit data characters as are required to transmit the information. Any unused bits in the data characters are ignored. The bit that is requested by the start address is transmitted in the LSB at bit 0. The next "Bit" value is transmitted in the next bit (bit 1). This continues until the last bit location (bit 7) of the LSB is reached. The next "Bit" value is then transmitted in the next data byte (LSB+1/MSB) at bit 0. This continues until all of the requested values have been transmitted. Any unused bits in the MSB are filled out with "0"s.
For simple single register variables the MSB of the register is transmitted first, with the LSB following immediately after. However, for variables that require multiple registers, i.e. the "Floating Point" and "Double Precision Floating Point" variables, the transmission order can be selected in the RS485 settings. By default, those values will be transmitted in Big Endian.
5.2.1 |
8-bit values |
|
|
||
|
|
|
|
|
|
|
|
Register |
Hi |
Lo |
|
|
|
|
|
|
|
|
|
N |
|
0x00 |
Byte |
|
|
|
|
|
|
5.2.2 |
16-bit values |
|
|
||
|
|
|
|
||
|
|
Register Hi |
Lo |
NMSB LSB
5.2.332-bit values
Little Endian
Register |
Hi |
Lo |
|
|
|
N |
LSB + 1 |
LSB |
|
|
|
N + 1 |
MSB |
LSB + 2 |
|
|
|
|
|
|
Big Endian |
|
|
|
|
|
Register |
Hi |
Lo |
|
|
|
N |
MSB |
LSB + 2 |
|
|
|
N + 1 |
LSB + 1 |
LSB |
|
|
|
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
www.krohne.com |
9 |
5 MODBUS PROTOCOL |
MFC 400 |
|
Float (single precision, IEEE 754)
MSB |
LSB + 1 |
LSB + 1 |
LSB |
|
|
|
|
SEEEEEEE |
EMMMMMMM |
MMMMMMMM |
MMMMMMMM |
|
|
|
|
With S = sign, E = exponent, M = mantissa/fraction
5.2.4 64-bit values
Little Endian |
|
|
|
|
|
Register |
Hi |
Lo |
|
|
|
N |
LSB + 1 |
LSB |
|
|
|
N + 1 |
LSB + 3 |
LSB + 2 |
|
|
|
N + 2 |
LSB + 5 |
LSB + 4 |
|
|
|
N + 3 |
MSB |
LSB + 6 |
|
|
|
|
|
|
Big Endian |
|
|
|
|
|
Register |
Hi |
Lo |
|
|
|
N |
MSB |
LSB + 6 |
|
|
|
N + 1 |
LSB + 5 |
LSB + 4 |
|
|
|
N + 2 |
LSB + 3 |
LSB + 2 |
|
|
|
N + 3 |
LSB + 1 |
LSB |
|
|
|
Double (double precision, IEEE 754)
MSB |
LSB + 6 |
LSB + 5 |
LSB + 4 |
|
|
|
|
SEEEEEEE |
EEEEMMMM |
MMMMMMMM |
MMMMMMMM |
|
|
|
|
LSB + 3 |
LSB + 2 |
LSB + 1 |
LSB |
|
|
|
|
MMMMMMMM |
MMMMMMMM |
MMMMMMMM |
MMMMMMMM |
|
|
|
|
With S = sign, E = exponent, M = mantissa/fraction
10 |
www.krohne.com |
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
|
|
MODBUS PROTOCOL 5 |
|
MFC 400 |
|
|
|
|
5.3 Modbus Register Addresses
The signal converter supports four types of data references, which are associated to a range of Modbus registers.
Address range |
Primary tables |
Access rights |
|
|
|
0...9999 |
Coils |
read + write |
|
|
|
10000...19999 |
Discrete Inputs |
read |
|
|
|
20000...39999 |
Input Registers |
read |
|
|
|
40000...65535 |
Holding Registers |
read + write |
|
|
|
INFORMATION!
•Sometimes register numbers are asked for. The register numbers can be calculated by adding a 1 to the register address.
•Some systems cannot use addresses above 9999. For these systems there is the possibility to use the listed addresses but
-for Input Registers omit the leading 3 of 3xxxx;
-for Holding Registers omit the leading 4 of 4xxxx.
5.4Supported Function Codes
Function code |
Name |
|
|
|
|
dec |
hex |
|
|
|
|
01 |
01 |
Read Single Coil |
|
|
|
02 |
02 |
Read Descrete Inputs |
|
|
|
03 |
03 |
Read Holding Register |
|
|
|
04 |
04 |
Read Input Register |
|
|
|
05 |
05 |
Write Single Coil |
|
|
|
08 |
08 |
Diagnostics |
|
|
|
16 |
10 |
Write Multiple Register |
|
|
|
43 |
2B |
Encapsulated Interface Transport |
|
|
|
For detailed information about the telegrams structure of all function codes refer to Supported Modbus function codes on page 33.
5.5 Error messages
When the signal converter detects an error in the requests, received in a properly formatted telegram, it will respond with an error message. The error message response telegram is formatted as follows:
Address |
Function Code |
Error Code |
CRC Lo |
CRC Hi |
|
|
|
|
|
The msb (most significant bit) of the requested function code is set (add 0d128 / 0x80) in the reponse telegram to indicate an error has been detected. For example, if an error were detected in a function 1 request, then the returned function code would be 0x81 (0d129).
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |
www.krohne.com |
11 |
5 MODBUS PROTOCOL |
MFC 400 |
|
The single data character in the response telegram will indicate the type of error detected.
These are as follows:
Error |
Name |
Meaning |
Code |
|
|
|
|
|
01 |
ILLEGAL FUNCTION |
The requested function code is not supported or not valid due to the |
|
|
current settings of the device. |
02 |
ILLEGAL DATA |
The register requested is not valid or the quantity of requested |
|
ADDRESS |
registers hits invalid registers. |
03 |
ILLEGAL DATA VALUE |
The requested data is invalid for the register being written. |
|
|
|
04 |
SLAVE DEVICE |
An unrecoverable error occurred while the slave was attempting to |
|
FAILURE |
perform the requested action. |
|
|
|
06 |
SLAVE DEVICE BUSY |
The slave is unable to process the requested command because a |
|
|
long-duration command is in progress. The master should |
|
|
retransmit the message later. |
|
|
|
Errors due to communications faults (CRC errors, Parity errors etc.) are logged but no response is returned because the data in the received telegram is deemed unreliable. The master system can read the error logs by using the diagnostics command (for details on Function Code 0x08 refer to Diagnostics on page 13).
5.6 Device identification
Retrieve all of the identification information from the signal converter.
Modbus Function Code "Encapsulated Interface Transport" (0x2B).
Modbus Encapsulated Interface (MEI) type (0x0E).
Category |
Object |
Object name |
Type |
Content |
|
Id |
|
|
|
|
|
|
|
|
Basic |
0x00 |
VendorName |
16 byte ASCII String |
KROHNE |
|
|
|
|
|
|
0x01 |
ProductCode |
10 byte ASCII String |
CG number; order code for the |
|
|
|
|
signal converter assembly |
|
|
|
|
|
|
0x02 |
MajorMinorRevision |
7 byte ASCII String |
Electronic Revision number |
|
|
|
|
|
Regular |
0x03 |
Vendor URL |
32 byte ASCII String |
www.krohne.com |
|
|
|
|
|
|
0x04 |
ProductName |
16 byte ASCII String |
MFC400 |
|
|
|
|
|
|
0x05 |
ModelName |
16 byte ASCII String |
Modbus |
|
|
|
|
|
|
0x06 |
UserApplicationName |
16 byte ASCII String |
User tag, displayed on the |
|
|
|
|
header of the local screen |
|
|
|
|
|
12 |
www.krohne.com |
05/2013 - 4002525102 - AD Modbus MFC 400 R02 en |